diff --git a/src/commands/accountv2.rs b/src/commands/accountv2.rs index 16a8e9f..353b98d 100644 --- a/src/commands/accountv2.rs +++ b/src/commands/accountv2.rs @@ -131,7 +131,7 @@ impl Link { Ok(self) } } -#[poise::command(slash_command, subcommands("add", "list", "context_list"))] +#[poise::command(slash_command, subcommands("add", "list"))] pub(crate) async fn account(_ctx: Context<'_>) -> Result<(), Error> { // root of slash-commands is not invokable. unreachable!() @@ -252,18 +252,18 @@ pub(crate) async fn list(ctx: Context<'_>, user: Option) -> Result<(), Err Ok(()) } -#[poise::command(context_menu_command="list accounts")] +#[poise::command(context_menu_command="Account list")] pub(crate) async fn context_list(ctx: Context<'_>, m: Message) -> Result<(), Error> { ctx.defer_ephemeral().await?; cooldown(&ctx, 600, 300)?; let pool: &Pool = &ctx.data().sqlite_pool; let s: String = list_string(pool, &m.author).await?; - let r: CreateReply = CreateReply::default().ephemeral(true); ctx.send( - r.content(s) - .allowed_mentions(CreateAllowedMentions::new().empty_roles().empty_users()), - ) - .await?; + CreateReply::default() + .content(s) + .allowed_mentions(CreateAllowedMentions::new().empty_roles().empty_users()) + .ephemeral(true) + ).await?; Ok(()) } diff --git a/src/main.rs b/src/main.rs index 749c005..d1ff87e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -48,6 +48,7 @@ async fn main() { commands::helpstart::helpstart(), commands::bots::bots(), commands::accountv2::account(), + commands::accountv2::context_list(), ], manual_cooldowns: true, prefix_options: poise::PrefixFrameworkOptions { @@ -96,7 +97,7 @@ async fn event_handler( match event { FullEvent::Ready { data_about_bot, .. } => { println!("Logged in as {}", data_about_bot.user.name); - } + }, FullEvent::GuildMemberAddition { new_member } => { println!("join event"); if new_member.guild_id.get() == 1256217633959841853_u64 { @@ -108,13 +109,13 @@ async fn event_handler( if interaction.application_id().get() == 1165594074473037824 && interaction.kind() == InteractionType::Component { handlers::bot_interaction::component(ctx, interaction, data).await?; } - } + }, FullEvent::Message { new_message } => { handlers::message::on_create(ctx, new_message).await?; - } + }, FullEvent::ThreadCreate { thread } => { handlers::thread::on_create(ctx, thread).await?; - } + }, _ => {} } Ok(())