feat(discord): Commands description
- Added english commands description - Added russian commands description - Changed override option on /quest update to reset dates - Commented out all deadline functionality
This commit is contained in:
parent
787118309a
commit
60aa5fcb34
8 changed files with 191 additions and 22 deletions
|
|
@ -21,14 +21,20 @@ async fn account_balance_string(
|
|||
formatter.fmt(&strings.scoreboard.line_format)
|
||||
}
|
||||
|
||||
/// Reset user account, including balance, unlocked rooms and completed quests
|
||||
#[poise::command(
|
||||
prefix_command,
|
||||
slash_command,
|
||||
guild_only,
|
||||
required_permissions = "ADMINISTRATOR",
|
||||
name_localized("ru", "сбросить"),
|
||||
description_localized("ru", "Сбросить аккаунт пользователя, вкл. баланс, открытые комнаты и пройденные квесты"),
|
||||
)]
|
||||
pub async fn reset(
|
||||
ctx: Context<'_>,
|
||||
#[description = "The user to reset"]
|
||||
#[name_localized("ru", "кого")]
|
||||
#[description_localized("ru", "Сбрасываемый пользователь")]
|
||||
who: User,
|
||||
) -> Result<(), Error> {
|
||||
let accounts = ctx.data().config.load_accounts();
|
||||
|
|
@ -52,10 +58,13 @@ pub async fn reset(
|
|||
Ok(())
|
||||
}
|
||||
|
||||
/// Show scoreboard
|
||||
#[poise::command(
|
||||
prefix_command,
|
||||
slash_command,
|
||||
guild_only,
|
||||
name_localized("ru", "счёт"),
|
||||
description_localized("ru", "Отобразить таблицу лидеров"),
|
||||
)]
|
||||
pub async fn scoreboard(
|
||||
ctx: Context<'_>,
|
||||
|
|
@ -98,6 +107,7 @@ pub async fn scoreboard(
|
|||
slash_command,
|
||||
guild_only,
|
||||
subcommands("give", "set"),
|
||||
name_localized("ru", "баланс"),
|
||||
)]
|
||||
pub async fn balance(
|
||||
_ctx: Context<'_>,
|
||||
|
|
@ -105,14 +115,23 @@ pub async fn balance(
|
|||
Ok(())
|
||||
}
|
||||
|
||||
/// Give points to another user
|
||||
#[poise::command(
|
||||
prefix_command,
|
||||
slash_command,
|
||||
guild_only,
|
||||
name_localized("ru", "передать"),
|
||||
description_localized("ru", "Передать очки другому пользователю"),
|
||||
)]
|
||||
pub async fn give(
|
||||
ctx: Context<'_>,
|
||||
#[description = "Recipient"]
|
||||
#[name_localized("ru", "кому")]
|
||||
#[description_localized("ru", "Получатель")]
|
||||
who: User,
|
||||
#[description = "Amount of the points to give"]
|
||||
#[name_localized("ru", "количество")]
|
||||
#[description_localized("ru", "Количество очков для передачи")]
|
||||
amount: u32,
|
||||
) -> Result<(), Error> {
|
||||
if ctx.author() == &who {
|
||||
|
|
@ -153,15 +172,24 @@ pub async fn give(
|
|||
Ok(())
|
||||
}
|
||||
|
||||
/// Set current user balance
|
||||
#[poise::command(
|
||||
prefix_command,
|
||||
slash_command,
|
||||
guild_only,
|
||||
required_permissions = "ADMINISTRATOR",
|
||||
name_localized("ru", "установить"),
|
||||
description_localized("ru", "Устанавливает текущий баланс пользователя"),
|
||||
)]
|
||||
pub async fn set(
|
||||
ctx: Context<'_>,
|
||||
#[description = "User, whose balance will be modified"]
|
||||
#[name_localized("ru", "чей")]
|
||||
#[description_localized("ru", "Пользователь, чей баланс будет изменён")]
|
||||
who: User,
|
||||
#[description = "New balance of the user"]
|
||||
#[name_localized("ru", "количество")]
|
||||
#[description_localized("ru", "Новый баланс пользователя")]
|
||||
amount: u32,
|
||||
) -> Result<(), Error> {
|
||||
let mut accounts = ctx.data().config.load_accounts();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue