diff options
Diffstat (limited to 'commands/util/say.js')
-rw-r--r-- | commands/util/say.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/commands/util/say.js b/commands/util/say.js new file mode 100644 index 0000000..17af382 --- /dev/null +++ b/commands/util/say.js @@ -0,0 +1,36 @@ +const fs = require('fs') +const path = require("path"); +let config_loc = __filename+".json" +const { PermissionsBitField } = require('discord.js'); +let config = JSON.parse(fs.readFileSync(config_loc)) +module.exports = { + name : "say", + command: ["say"], + mod_only: true, + config:config, + config_loc:config_loc, + async main (client,Discord,message,args){ + let id = message.mentions.channels.first() + let echo = message.content.slice(8) + if(id){ + echo = echo.split(/ +/g); + echo.shift(); + echo = echo.join(' ') + } else { + id = message.channel + } + this.exec(client,{id:id,echo:echo}) + }, + s_options:[{type:"string",name:"echo",desc:"message to be said",required:true,autocomplete:false}, + {type:"channel",name:"channel",desc:"channel to be sent to",required:false,autocomplete:false}], + async s_main (client,Discord,interaction){ + this.exec(client, + {echo:interaction.options.getString("echo"), + id:interaction.options.getChannel("channel") ?? interaction.channel}) + await interaction.reply({ content:'sent', ephemeral: true }) + interaction.deleteReply() + }, + async exec(client,info){ + return info.id.send(info.echo) + } +}
\ No newline at end of file |