Haha-Yes/commands/general/sayd.js

38 lines
740 B
JavaScript
Raw Normal View History

2018-12-30 01:20:24 +01:00
const { Command } = require('discord-akairo');
2019-02-08 18:59:47 +01:00
const rand = require('../../rand.js');
2018-12-05 00:52:21 +01:00
2019-01-02 08:09:45 +01:00
class SaydCommand extends Command {
constructor() {
super('sayd', {
aliases: ['sayd'],
category: 'general',
clientPermissions: 'MANAGE_MESSAGES',
args: [
{
id: 'text',
2019-01-10 20:45:29 +01:00
type: 'string',
match: 'rest'
2019-01-02 08:09:45 +01:00
}
],
description: {
content: 'Repeat what you say but delete the text you sent',
usage: '[text]',
examples: ['[member] is a big [adverbs] [verb]']
}
});
}
2018-09-18 15:35:06 +02:00
2019-01-02 08:09:45 +01:00
async exec(message, args) {
let text = args.text;
2019-01-02 18:45:53 +01:00
if (!text)
return;
2018-11-28 20:27:29 +01:00
2019-02-08 18:59:47 +01:00
text = rand.random(text, message);
2018-11-28 20:27:29 +01:00
2019-01-02 08:09:45 +01:00
// Send the final text
message.delete();
return message.channel.send(text);
}
2018-12-30 01:20:24 +01:00
}
2019-01-02 08:09:45 +01:00
module.exports = SaydCommand;