EcoBot/commands/send.js
2021-11-23 00:37:00 +01:00

28 lines
No EOL
663 B
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

module.exports = {
api: {
name: "send",
description: "Sends a message in current or specificed channel.",
options: [
{
name: "message",
description: "Message to send",
type: 3,
required: true
},
{
name: "channel",
description: "Channel to send it in",
type: 7,
required: false
}
]
},
run: (int, client, index) => {
const message = int.options.getString("message");
const specifiedChannel = int.options.getChannel("channel");
const channel = !!specifiedChannel ? specifiedChannel : int.channel;
channel.send(message).then(msg => {
int.reply({content: "Message sent!", ephemeral: true});
});
}
}