Basic guild_popin

This commit is contained in:
2023-03-11 18:18:36 -05:00
parent c9164cd2db
commit 23887792a2
4 changed files with 55 additions and 3 deletions

View File

@@ -4,6 +4,8 @@ use serenity::model::prelude::Guild;
use serenity::prelude::Context;
use serenity::prelude::*;
use crate::utils::*;
pub struct Handler;
#[async_trait]
@@ -14,11 +16,17 @@ impl EventHandler for Handler {
// private channels, and more.
//
// In this case, just print what the current user's username is.
async fn ready(&self, _ctx: Context, ready: Ready) {
async fn ready(&self, ctx: Context, ready: Ready) {
println!("{} is connected!", ready.user.name);
println!("Initialize guild voice popin state");
guildPopin::init(ctx).await;
}
async fn guild_create(&self, _ctx: Context, guild: Guild, _new: bool) {
println!("Guild joined: {}", guild.name);
async fn guild_create(&self, ctx: Context, guild: Guild, _new: bool) {
println!("Guild joined: {}", guild.name);
guildPopin::addGuild(ctx, guild).await;
}
}