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 : {
2019-04-06 18:53:40 +02:00
content : 'Repeat what you say but delete the text you sent, [Click here to see the complete list of "tag"](https://cdn.discordapp.com/attachments/502198809355354133/561043193949585418/unknown.png)' ,
2019-01-02 08:09:45 +01:00
usage : '[text]' ,
2019-04-06 18:53:40 +02:00
examples : [ '[member] is a big [adverbs] [verbs]' ]
2019-01-02 08:09:45 +01:00
}
} ) ;
}
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
2019-02-18 15:55:20 +01:00
message . delete ( ) ;
2019-02-18 16:01:00 +01:00
return message . util . send ( '===ANTI-SNIPE MESSAGE===' )
. then ( ( ) => {
message . util . edit ( text ) ;
2019-02-18 15:52:48 +01:00
} ) ;
2019-01-02 08:09:45 +01:00
}
2018-12-30 01:20:24 +01:00
}
2019-01-02 08:09:45 +01:00
module . exports = SaydCommand ;