diff options
author | ame <[email protected]> | 2024-08-28 01:55:32 -0500 |
---|---|---|
committer | ame <[email protected]> | 2024-08-28 01:55:32 -0500 |
commit | c47415cd3e4734b111c7035074dd57e32cd60be7 (patch) | |
tree | f36d09f3db900e886973f61ac22cdd7e6572cf4a /commands/util | |
parent | a3b50cdacc5653d49784a84276284e421e96cc8a (diff) |
Diffstat (limited to 'commands/util')
-rw-r--r-- | commands/util/say.js | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/commands/util/say.js b/commands/util/say.js index 1966512..eda3675 100644 --- a/commands/util/say.js +++ b/commands/util/say.js @@ -55,22 +55,26 @@ module.exports = { {type:"string",name:"footer",desc:"footer text",required:false,autocomplete:false}, ]}], async s_main (client,Discord,interaction){ - let action = interaction.options.getSubcommand() - if(action == "text"){ - this.exec(client, - {echo:interaction.options.getString("echo"), - id:interaction.options.getChannel("channel") ?? interaction.channel}) - await interaction.reply({ content:'sent', ephemeral: true }) - interaction.deleteReply() - } else if(action == "embed"){ - this.embed_exec(client, {msg:interaction,id:interaction.channel}) + try{ + let action = interaction.options.getSubcommand() + if(action == "text"){ + this.exec(client, + {echo:interaction.options.getString("echo"), + id:interaction.options.getChannel("channel") ?? interaction.channel}) + await interaction.reply({ content:'sent', ephemeral: true }) + interaction.deleteReply() + } else if(action == "embed"){ + this.embed_exec(client, {msg:interaction,id:interaction.channel}) + } + } catch(e) { + info.interaction.channel.reply({ content: 'error sending message, most likely from permissions or length', ephemeral: true}) } }, async exec(client,info){ - return info.id.send(info.echo) + return await info.id.send(info.echo) }, async embed_exec(client, info){ |