added defer
This commit is contained in:
parent
43f59e0c49
commit
22360577d0
5 changed files with 6 additions and 0 deletions
|
@ -12,6 +12,7 @@ pub(crate) async fn account(_ctx: Context<'_>) -> Result<(), Error> {
|
||||||
|
|
||||||
#[poise::command(slash_command)]
|
#[poise::command(slash_command)]
|
||||||
pub(crate) async fn add(ctx: Context<'_>, ign: String) -> Result<(), Error> {
|
pub(crate) async fn add(ctx: Context<'_>, ign: String) -> Result<(), Error> {
|
||||||
|
ctx.defer_ephemeral().await?;
|
||||||
let pool = ctx.data().sqlite_pool.clone();
|
let pool = ctx.data().sqlite_pool.clone();
|
||||||
let minecraft_uuid = minecraft_uuid_for_username(ign.clone()).await?;
|
let minecraft_uuid = minecraft_uuid_for_username(ign.clone()).await?;
|
||||||
let hypixel_linked_discord = linked_discord_for_uuid(
|
let hypixel_linked_discord = linked_discord_for_uuid(
|
||||||
|
@ -49,6 +50,7 @@ pub(crate) async fn remove(ctx: Context<'_>) -> Result<(), Error> {
|
||||||
|
|
||||||
#[poise::command(slash_command)]
|
#[poise::command(slash_command)]
|
||||||
pub(crate) async fn list(ctx: Context<'_>, user: Option<User>) -> Result<(), Error> {
|
pub(crate) async fn list(ctx: Context<'_>, user: Option<User>) -> Result<(), Error> {
|
||||||
|
ctx.defer_ephemeral().await?;
|
||||||
let user_id = user.clone().map(|user| user.id.get());
|
let user_id = user.clone().map(|user| user.id.get());
|
||||||
let user_name = user.clone().map(|user| user.name);
|
let user_name = user.clone().map(|user| user.name);
|
||||||
let author_name = ctx.author().name.clone();
|
let author_name = ctx.author().name.clone();
|
||||||
|
|
|
@ -10,6 +10,7 @@ pub(crate) async fn bots(
|
||||||
#[description = "default: 0"]
|
#[description = "default: 0"]
|
||||||
bots: u8,
|
bots: u8,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
|
ctx.defer_ephemeral().await?;
|
||||||
*ctx.data().bots.write().await = bots;
|
*ctx.data().bots.write().await = bots;
|
||||||
let reply = format!("{} bots are now registered as available", bots).to_string();
|
let reply = format!("{} bots are now registered as available", bots).to_string();
|
||||||
command_helper::send_simple(ctx, reply).await
|
command_helper::send_simple(ctx, reply).await
|
||||||
|
|
|
@ -13,6 +13,7 @@ pub(crate) async fn helpstart(
|
||||||
#[rename = "current"]
|
#[rename = "current"]
|
||||||
current_players: u8,
|
current_players: u8,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
|
ctx.defer_ephemeral().await?;
|
||||||
let needed_players = 4 - current_players;
|
let needed_players = 4 - current_players;
|
||||||
let bots = *ctx.data().bots.read().await;
|
let bots = *ctx.data().bots.read().await;
|
||||||
|
|
||||||
|
|
|
@ -72,6 +72,7 @@ pub(crate) async fn lfg(
|
||||||
#[rename = "message"]
|
#[rename = "message"]
|
||||||
note: Option<String>,
|
note: Option<String>,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
|
ctx.defer_ephemeral().await?;
|
||||||
let mut reply: CreateReply = CreateReply::default();
|
let mut reply: CreateReply = CreateReply::default();
|
||||||
let guild_id = ctx.guild_id().unwrap().get();
|
let guild_id = ctx.guild_id().unwrap().get();
|
||||||
reply = match cooldown(&ctx, 600, 300) {
|
reply = match cooldown(&ctx, 600, 300) {
|
||||||
|
|
|
@ -4,6 +4,7 @@ const XD:&str = "⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
|
||||||
|
|
||||||
#[poise::command(slash_command)]
|
#[poise::command(slash_command)]
|
||||||
pub(crate) async fn xd(ctx: Context<'_>) -> Result<(), Error> {
|
pub(crate) async fn xd(ctx: Context<'_>) -> Result<(), Error> {
|
||||||
|
ctx.defer_ephemeral().await?;
|
||||||
ctx.say(XD).await?;
|
ctx.say(XD).await?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue