feat: Implemented guild check
- Also added more error logging
This commit is contained in:
parent
d584340f01
commit
d188bba16e
8 changed files with 51 additions and 9 deletions
|
|
@ -3,7 +3,7 @@ use std::{future, str::FromStr};
|
|||
use poise::serenity_prelude::{CreateMessage, EditMessage, Message, futures::StreamExt};
|
||||
use squad_quest::{SquadObject, quest::{Quest, QuestDifficulty}};
|
||||
use toml::value::Date;
|
||||
use crate::{Context, Error};
|
||||
use crate::{Context, Error,commands::guild};
|
||||
|
||||
async fn find_quest_message(ctx: Context<'_>, id: u16) -> Result<Option<Message>, Error>{
|
||||
ctx.defer().await?;
|
||||
|
|
@ -34,6 +34,7 @@ fn make_quest_message_content(ctx: Context<'_>, quest: &Quest) -> String {
|
|||
prefix_command,
|
||||
slash_command,
|
||||
guild_only,
|
||||
check = "guild",
|
||||
subcommands("list", "create", "update", "publish", "delete"),
|
||||
required_permissions = "ADMINISTRATOR",
|
||||
name_localized("ru", "квест"),
|
||||
|
|
@ -49,6 +50,7 @@ pub async fn quest(
|
|||
prefix_command,
|
||||
slash_command,
|
||||
guild_only,
|
||||
check = "guild",
|
||||
required_permissions = "ADMINISTRATOR",
|
||||
name_localized("ru", "список"),
|
||||
description_localized("ru", "Вывести все квесты")
|
||||
|
|
@ -114,6 +116,7 @@ impl From<DateWrapper> for Date {
|
|||
slash_command,
|
||||
required_permissions = "ADMINISTRATOR",
|
||||
guild_only,
|
||||
check = "guild",
|
||||
name_localized("ru", "создать"),
|
||||
description_localized("ru", "Создать квест и получить его идентификатор"),
|
||||
)]
|
||||
|
|
@ -202,6 +205,7 @@ pub async fn create(
|
|||
slash_command,
|
||||
required_permissions = "ADMINISTRATOR",
|
||||
guild_only,
|
||||
check = "guild",
|
||||
name_localized("ru", "обновить"),
|
||||
description_localized("ru", "Обновить выбранные значения указанного квеста"),
|
||||
)]
|
||||
|
|
@ -339,6 +343,7 @@ pub async fn publish_inner(ctx: Context<'_>, quest: &mut Quest) -> Result<Messag
|
|||
slash_command,
|
||||
required_permissions = "ADMINISTRATOR",
|
||||
guild_only,
|
||||
check = "guild",
|
||||
name_localized("ru", "опубликовать"),
|
||||
description_localized("ru", "Отметить квест как публичный и отправить его сообщение в канал квестов"),
|
||||
)]
|
||||
|
|
@ -378,6 +383,7 @@ pub async fn publish(
|
|||
slash_command,
|
||||
required_permissions = "ADMINISTRATOR",
|
||||
guild_only,
|
||||
check = "guild",
|
||||
name_localized("ru", "удалить"),
|
||||
description_localized("ru", "Удалить квест (и его сообщение, если он был опубликован)"),
|
||||
)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue