Check inbox status on name change
This commit is contained in:
parent
4eaae45f5f
commit
f7f8ca39aa
15
src/main.rs
15
src/main.rs
|
@ -1,6 +1,5 @@
|
|||
use async_trait::async_trait;
|
||||
use inbox::*;
|
||||
use itertools::Itertools;
|
||||
use lazy_static::lazy_static;
|
||||
use serenity::client::Client;
|
||||
use serenity::framework::standard::{
|
||||
|
@ -98,6 +97,20 @@ async fn name(ctx: &Context, msg: &Message) -> CommandResult {
|
|||
msg.author.id,
|
||||
now.unix_timestamp()
|
||||
);
|
||||
if msg.author.id == INBOX_OWNER {
|
||||
let msg_count = INBOX.count_messages("name");
|
||||
if msg_count > 0 {
|
||||
send_or_log!(
|
||||
msg.reply(&ctx, format!("{} neue Nachrichten für {}", msg_count, name))
|
||||
.await
|
||||
);
|
||||
} else {
|
||||
send_or_log!(
|
||||
msg.reply(&ctx, format!("Keine neuen Nachrichten für {}", name))
|
||||
.await
|
||||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
send_or_log!(msg.reply(&ctx, "Please specify a new name.").await);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user