25 lines
696 B
Rust
25 lines
696 B
Rust
use serenity::{
|
|
async_trait,
|
|
model::prelude::*,
|
|
prelude::{Context, EventHandler},
|
|
};
|
|
pub struct Handler;
|
|
|
|
#[async_trait]
|
|
impl EventHandler for Handler {
|
|
async fn ready(&self, ctx: Context, r: Ready) {
|
|
println!("Successfully logged in as {}", r.user.name);
|
|
println!("Can see {} guilds", r.guilds.len());
|
|
let game = Activity::listening("CHEESE");
|
|
let status = OnlineStatus::DoNotDisturb;
|
|
|
|
ctx.set_presence(Some(game), status).await;
|
|
}
|
|
|
|
async fn message(&self, ctx: Context, new_message: Message) {
|
|
if new_message.mentions_user_id(140652945032216576) {
|
|
new_message.react(&ctx, '🐀').await.ok();
|
|
}
|
|
}
|
|
}
|