From 99779de823e1751c3da13e0b7b0f639ddecca7da Mon Sep 17 00:00:00 2001 From: ame Date: Tue, 26 Sep 2023 23:12:35 -0500 Subject: init --- commands/util/say.js | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 commands/util/say.js (limited to 'commands/util/say.js') 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 -- cgit v1.2.3