command descriptions

This commit is contained in:
Stachelbeere1248 2024-12-15 22:01:20 +01:00
parent 19befad93c
commit f44af892b4
Signed by: Stachelbeere1248
SSH key fingerprint: SHA256:IozEKdw2dB8TZxkpPdMxcWSoWTIMwoLaCcZJ1AJnY2o
6 changed files with 10 additions and 24 deletions

View file

@ -128,6 +128,7 @@ pub(crate) async fn account(_ctx: Context<'_>) -> Result<(), Error> {
interaction_context = "Guild|BotDm|PrivateChannel",
ephemeral = "false",
)]
/// Verify a Minecraft account on the Zombies MultiPlayer Discord.
pub(crate) async fn add<'a>(
ctx: Context<'_>,
#[description = "Minecraft username"]
@ -230,35 +231,15 @@ pub(crate) async fn add<'a>(
slash_command,
install_context = "User|Guild",
interaction_context = "Guild|BotDm|PrivateChannel",
ephemeral = "false",
)]
pub(crate) async fn list(ctx: Context<'_>, user: Option<User>) -> Result<(), Error> {
ctx.defer().await?;
cooldown(&ctx, 600, 300)?;
let user: User = user.unwrap_or(ctx.author().clone());
let pool: &Pool<Sqlite> = &ctx.data().sqlite_pool;
let s: String = list_string(pool, &user).await?;
let r: CreateReply = CreateReply::default();
ctx.send(
r.content(s)
.allowed_mentions(CreateAllowedMentions::new().empty_roles().empty_users()),
)
.await?;
Ok(())
}
#[poise::command(
slash_command,
install_context = "User|Guild",
interaction_context = "Guild|PrivateChannel",
ephemeral = "true",
context_menu_command="Account list"
)]
pub(crate) async fn context_list(ctx: Context<'_>, u: User) -> Result<(), Error> {
/// List a users linked minecraft Accounts.
pub(crate) async fn list(ctx: Context<'_>, user: User) -> Result<(), Error> {
ctx.defer().await?;
cooldown(&ctx, 600, 300)?;
let pool: &Pool<Sqlite> = &ctx.data().sqlite_pool;
let s: String = list_string(pool, &u).await?;
let s: String = list_string(pool, &user).await?;
ctx.send(
CreateReply::default()
.content(s)

View file

@ -12,6 +12,7 @@ use crate::error::Error;
interaction_context = "Guild|BotDm|PrivateChannel",
ephemeral = "false",
)]
/// Change how many helpstart bots are online, to limit usage of helpstart pings.
pub(crate) async fn bots(
ctx: Context<'_>,
#[min = 0_u8]

View file

@ -11,6 +11,7 @@ use crate::error::Error;
interaction_context = "Guild",
ephemeral = "false",
)]
/// Ping the @helpstart to fill a queue.
pub(crate) async fn helpstart(
ctx: Context<'_>,
#[min = 1_u8]

View file

@ -49,6 +49,7 @@ pub enum Difficulty {
interaction_context = "Guild",
ephemeral = "false",
)]
/// Find a team for Hypixel Zombies.
pub(crate) async fn lfg(
ctx: Context<'_>,
#[rename = "map"] map: Map,
@ -143,6 +144,7 @@ enum ExpertMap {
ephemeral = "false",
rename = "lfg-expert"
)]
/// Find a team of skilled players.
pub(crate) async fn expert(
ctx: Context<'_>,
#[rename = "map"] mode: ExpertMap,
@ -217,6 +219,7 @@ enum OtherPing {
ephemeral = "false",
rename = "lfg-other"
)]
/// Find people to play other games with.
pub(crate) async fn other(
ctx: Context<'_>,
#[rename = "game"] game: OtherPing,

View file

@ -17,6 +17,7 @@ const XD: &str = "⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
interaction_context = "Guild|BotDm|PrivateChannel",
ephemeral = "false",
)]
/// Useless command to check if the bot is online.
pub(crate) async fn xd(ctx: Context<'_>) -> Result<(), Error> {
ctx.defer_ephemeral().await?;
ctx.say(XD).await?;

View file

@ -48,7 +48,6 @@ async fn main() {
commands::helpstart::helpstart(),
commands::bots::bots(),
commands::accountv2::account(),
commands::accountv2::context_list(),
],
manual_cooldowns: true,
prefix_options: poise::PrefixFrameworkOptions {