Guild Create Event

This commit is contained in:
2023-03-10 18:17:21 -05:00
parent 0deb810f20
commit dabefbb342

View File

@@ -1,5 +1,6 @@
use serenity::async_trait;
use serenity::model::gateway::Ready;
use serenity::model::prelude::Guild;
use serenity::prelude::Context;
use serenity::prelude::*;
@@ -15,9 +16,9 @@ impl EventHandler for Handler {
// In this case, just print what the current user's username is.
async fn ready(&self, _ctx: Context, ready: Ready) {
println!("{} is connected!", ready.user.name);
// for g_id in ctx.cache.guilds() {
// let g = ctx.cache.guild(g_id).expect("Unable to fetch guild");
// println!("Initializing {}...", g.name);
// }
}
async fn guild_create(&self, _ctx: Context, guild: Guild, _new: bool) {
println!("Guild joined: {}", guild.name);
}
}