update hs command
This commit is contained in:
parent
22360577d0
commit
ae34622647
3 changed files with 9 additions and 5 deletions
|
@ -2,7 +2,8 @@ use poise::CreateReply;
|
|||
use serde::{Deserialize, Serialize};
|
||||
use serenity::all::{ChannelId, CreateMessage, User};
|
||||
use serenity::builder::CreateAllowedMentions;
|
||||
use sqlx::{query_as, Pool, Sqlite};
|
||||
use sqlx::{Pool, query_as, Sqlite};
|
||||
|
||||
use crate::{Context, Error};
|
||||
|
||||
#[poise::command(slash_command, subcommands("add", "list"))]
|
||||
|
|
|
@ -13,11 +13,15 @@ pub(crate) async fn helpstart(
|
|||
#[rename = "current"]
|
||||
current_players: u8,
|
||||
) -> Result<(), Error> {
|
||||
ctx.defer_ephemeral().await?;
|
||||
let needed_players = 4 - current_players;
|
||||
let bots = *ctx.data().bots.read().await;
|
||||
|
||||
let g = ctx.guild_id().unwrap().get();
|
||||
let mut reply = CreateReply::default();
|
||||
let ping = match g {
|
||||
1256217633959841853_u64 => 1257411572092113017_u64,
|
||||
995300932164276234_u64 => 1008075054971621448_u64,
|
||||
_ => 0_u64
|
||||
};
|
||||
|
||||
reply = if bots >= needed_players {
|
||||
reply.content("Bots available. Please use <@424767825001971715> in the bot-commands channel instead.")
|
||||
|
@ -26,7 +30,7 @@ pub(crate) async fn helpstart(
|
|||
match command_helper::cooldown(&ctx, 1200, 600) {
|
||||
Ok(_) => reply
|
||||
.content(format!(
|
||||
"<@&1008075054971621448>\nneed: {}",
|
||||
"<@&{ping}>\nneed: {}",
|
||||
needed_players - bots
|
||||
))
|
||||
.ephemeral(false)
|
||||
|
|
|
@ -72,7 +72,6 @@ pub(crate) async fn lfg(
|
|||
#[rename = "message"]
|
||||
note: Option<String>,
|
||||
) -> Result<(), Error> {
|
||||
ctx.defer_ephemeral().await?;
|
||||
let mut reply: CreateReply = CreateReply::default();
|
||||
let guild_id = ctx.guild_id().unwrap().get();
|
||||
reply = match cooldown(&ctx, 600, 300) {
|
||||
|
|
Loading…
Add table
Reference in a new issue