minor bug fix
This commit is contained in:
parent
f86eefe7c4
commit
96d0377665
2 changed files with 12 additions and 11 deletions
|
@ -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<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(())
|
||||
}
|
||||
|
||||
|
|
|
@ -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(())
|
||||
|
|
Loading…
Add table
Reference in a new issue