feat(command/gestion): adding the debug print to set
This commit is contained in:
parent
d0bedf904c
commit
e388ddfc8c
1 changed files with 8 additions and 8 deletions
|
|
@ -20,13 +20,13 @@ async fn set_picture(slashcmd: &Set, ctx: &Context, cmd: &CommandInteraction, db
|
||||||
_ => return Err(anyhow::anyhow!("Expected a subcommand")),
|
_ => return Err(anyhow::anyhow!("Expected a subcommand")),
|
||||||
};
|
};
|
||||||
|
|
||||||
let url = inner_options
|
let url: &str = inner_options
|
||||||
.iter()
|
.iter()
|
||||||
.find(|opt| opt.name == "link")
|
.find(|opt| opt.name == "link")
|
||||||
.ok_or_else(|| anyhow::anyhow!("Option 'link' not found"))?
|
.ok_or_else(|| anyhow::anyhow!("Option 'link' not found"))?
|
||||||
.value
|
.value
|
||||||
.as_str()
|
.as_str()
|
||||||
.ok_or_else(|| anyhow::anyhow!("Option 'link' is not a string"))?;
|
.ok_or_else(|| anyhow::anyhow!("Option 'link' is not a string"))?;
|
||||||
|
|
||||||
let attachment: CreateAttachment = CreateAttachment::url(&ctx.http, &url)
|
let attachment: CreateAttachment = CreateAttachment::url(&ctx.http, &url)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
@ -85,7 +85,7 @@ impl SlashCommand for Set {
|
||||||
_database: &PgPool,
|
_database: &PgPool,
|
||||||
_emoji: &EmojiConfig,
|
_emoji: &EmojiConfig,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
debug!("Set command called");
|
debug!("{} command called", self.name());
|
||||||
if !is_owner(_database, &command.user.id.to_string()).await? {
|
if !is_owner(_database, &command.user.id.to_string()).await? {
|
||||||
let message: CreateInteractionResponseMessage = CreateInteractionResponseMessage::new()
|
let message: CreateInteractionResponseMessage = CreateInteractionResponseMessage::new()
|
||||||
.content(format!("{} | This command is only for the owner", _emoji.answer.no))
|
.content(format!("{} | This command is only for the owner", _emoji.answer.no))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue