minor bug fix

This commit is contained in:
Stachelbeere1248 2024-11-15 23:48:34 +01:00
parent f86eefe7c4
commit 5fdc09a362
Signed by: Stachelbeere1248
SSH key fingerprint: SHA256:IozEKdw2dB8TZxkpPdMxcWSoWTIMwoLaCcZJ1AJnY2o
2 changed files with 10 additions and 10 deletions

View file

@ -252,18 +252,18 @@ pub(crate) async fn list(ctx: Context<'_>, user: Option<User>) -> 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<Sqlite> = &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(())
}

View file

@ -96,7 +96,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 +108,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(())