diff --git a/src/event_handlers.rs b/src/event_handlers.rs index 1f7fde1..d4429f2 100644 --- a/src/event_handlers.rs +++ b/src/event_handlers.rs @@ -44,18 +44,6 @@ impl EventHandler for Handler { ctx.set_activity(Activity::watching("for /play")).await; } - async fn cache_ready(&self, ctx: Context, _: Vec) { - let framework = ctx - .data - .read() - .await - .get::() - .cloned() - .expect("RegexFramework not found in context"); - - framework.build_slash(ctx).await; - } - async fn guild_create(&self, ctx: Context, guild: Guild, is_new: bool) { if is_new { if let Ok(token) = env::var("DISCORDBOTS_TOKEN") { diff --git a/src/framework.rs b/src/framework.rs index 7eab508..777fee9 100644 --- a/src/framework.rs +++ b/src/framework.rs @@ -597,6 +597,14 @@ impl RegexFramework { ); } + info!( + "[Shard {}] [Guild {}] /{} {:?}", + ctx.shard_id, + interaction.guild_id.unwrap(), + interaction.data.name, + args + ); + (command.fun)(&ctx, &interaction, Args { args }) .await .unwrap(); @@ -682,6 +690,14 @@ impl Framework for RegexFramework { let member = guild.member(&ctx, &msg.author).await.unwrap(); if command.check_permissions(&ctx, &guild, &member).await { + let _ = msg.channel_id.say( + &ctx, + format!( + "You **must** begin to switch to slash commands. All commands are available via slash commands now. If slash commands don't display in your server, please use this link: https://discord.com/api/oauth2/authorize?client_id={}&permissions=3165184&scope=applications.commands%20bot", + ctx.cache.current_user().id + ) + ).await; + (command.fun)(&ctx, &msg, Args::from(&args, command.args)) .await .unwrap(); diff --git a/src/main.rs b/src/main.rs index 2accd74..d846844 100644 --- a/src/main.rs +++ b/src/main.rs @@ -308,6 +308,8 @@ async fn main() -> Result<(), Box> { } } + framework_arc.build_slash(&client.cache_and_http.http).await; + if let Ok((Some(lower), Some(upper))) = env::var("SHARD_RANGE").map(|sr| { let mut split = sr .split(',')