Skip to content

Instantly share code, notes, and snippets.

@pizzafox pizzafox/say.js
Last active Feb 12, 2019

Embed
What would you like to do?
Say command made for the Commando Discord bot framework.
const { Command } = require('discord.js-commando');
class SayCommand extends Command {
constructor(client) {
super(client, {
name: 'say',
memberName: 'say',
group: 'test',
aliases: ['echo', 'repeat'],
description: 'A command that repeats whatever you say.',
details: 'Make me repeat your wordsmaking it look like I\'m a parrot',
examples: ['say Hello World', 'repeat Who Am I?'],
args: [
{
key: 'text',
prompt: 'What do you wish for me to say?',
type: 'string',
validate: text => /http[s]?:\/\//.test(text)
}
],
throttling: {
duration: 60, // This is the duration in seconds
usages: 2 // Allowed number of usages in the given duration
},
clientPermissions: ['MANAGE_MESSAGES']
});
}
run(msg, { text }) {
msg.delete();
return msg.say(text);
}
}
module.exports = SayCommand;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.