uberbot/src/commands/debug.rs
2022-07-17 20:20:13 +02:00

17 lines
401 B
Rust

use crate::bot::{Command, Context};
use async_trait::async_trait;
pub struct LastMsg;
#[async_trait]
impl Command for LastMsg {
async fn execute(&mut self, msg: Context<'_>) -> anyhow::Result<String> {
let nick = msg.content.unwrap_or(msg.author);
Ok(format!(
"{}: {:?}",
nick,
msg.history.last_msgs(nick, usize::MAX).await
))
}
}