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(()) 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> { pub(crate) async fn context_list(ctx: Context<'_>, m: Message) -> Result<(), Error> {
ctx.defer_ephemeral().await?; ctx.defer_ephemeral().await?;
cooldown(&ctx, 600, 300)?; cooldown(&ctx, 600, 300)?;
let pool: &Pool<Sqlite> = &ctx.data().sqlite_pool; let pool: &Pool<Sqlite> = &ctx.data().sqlite_pool;
let s: String = list_string(pool, &m.author).await?; let s: String = list_string(pool, &m.author).await?;
let r: CreateReply = CreateReply::default().ephemeral(true);
ctx.send( ctx.send(
r.content(s) CreateReply::default()
.allowed_mentions(CreateAllowedMentions::new().empty_roles().empty_users()), .content(s)
) .allowed_mentions(CreateAllowedMentions::new().empty_roles().empty_users())
.await?; .ephemeral(true)
).await?;
Ok(()) Ok(())
} }

View file

@ -96,7 +96,7 @@ async fn event_handler(
match event { match event {
FullEvent::Ready { data_about_bot, .. } => { FullEvent::Ready { data_about_bot, .. } => {
println!("Logged in as {}", data_about_bot.user.name); println!("Logged in as {}", data_about_bot.user.name);
} },
FullEvent::GuildMemberAddition { new_member } => { FullEvent::GuildMemberAddition { new_member } => {
println!("join event"); println!("join event");
if new_member.guild_id.get() == 1256217633959841853_u64 { 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 { if interaction.application_id().get() == 1165594074473037824 && interaction.kind() == InteractionType::Component {
handlers::bot_interaction::component(ctx, interaction, data).await?; handlers::bot_interaction::component(ctx, interaction, data).await?;
} }
} },
FullEvent::Message { new_message } => { FullEvent::Message { new_message } => {
handlers::message::on_create(ctx, new_message).await?; handlers::message::on_create(ctx, new_message).await?;
} },
FullEvent::ThreadCreate { thread } => { FullEvent::ThreadCreate { thread } => {
handlers::thread::on_create(ctx, thread).await?; handlers::thread::on_create(ctx, thread).await?;
} },
_ => {} _ => {}
} }
Ok(()) Ok(())