diff --git a/commands/admin/autoresponse.js b/commands/admin/autoresponse.js index e734795..8c71130 100644 --- a/commands/admin/autoresponse.js +++ b/commands/admin/autoresponse.js @@ -9,7 +9,10 @@ class autoresponseCommand extends Command { args: [ { id: 'text', - type: 'string' + type: 'string', + prompt: { + start: 'Do you want to **enable** or **disable** auto response?', + } }, { id: 'all', diff --git a/commands/admin/ban.js b/commands/admin/ban.js index 8c89347..b1a53ba 100644 --- a/commands/admin/ban.js +++ b/commands/admin/ban.js @@ -8,11 +8,18 @@ class BanCommand extends Command { args: [ { id: 'member', - type: 'member' + type: 'member', + prompt: { + start: 'Wich member do you want to ban?', + } }, { id: 'reasons', type: 'string', + prompt: { + start: 'For what reasons?', + optional: true + }, match: 'rest' } ], diff --git a/commands/admin/bye.js b/commands/admin/bye.js index 7e22280..5dd409f 100644 --- a/commands/admin/bye.js +++ b/commands/admin/bye.js @@ -12,6 +12,9 @@ class byeCommand extends Command { { id: 'message', type: 'string', + prompt: { + start: 'What message should the bot say when a user leave?', + }, match: 'rest' } ], diff --git a/commands/admin/kick.js b/commands/admin/kick.js index 6561b1f..c8e34f4 100644 --- a/commands/admin/kick.js +++ b/commands/admin/kick.js @@ -8,11 +8,18 @@ class KickCommand extends Command { args: [ { id: 'member', - type: 'member' + type: 'member', + prompt: { + start: 'Wich member do you want to ban?', + } }, { id: 'reasons', type: 'string', + prompt: { + start: 'For what reasons?', + optional: true + }, match: 'rest' } ], diff --git a/commands/admin/prune.js b/commands/admin/prune.js index 86d3548..e202d2e 100644 --- a/commands/admin/prune.js +++ b/commands/admin/prune.js @@ -8,6 +8,9 @@ class PruneCommand extends Command { args: [ { id: 'amount', + prompt: { + start: 'How many message should i delete?', + }, type: 'integer' } ], diff --git a/commands/admin/shameboard.js b/commands/admin/shameboard.js index 034ea22..b7f73d6 100644 --- a/commands/admin/shameboard.js +++ b/commands/admin/shameboard.js @@ -12,12 +12,25 @@ class shameboardCommand extends Command { { id: 'emote', type: 'string', + prompt: { + start: 'What emote should be used to enter the shameboard?', + optional: true + }, default: '✡' }, { id: 'count', + prompt: { + start: 'How many times should that emote be reacted to enter the shameboard?', + optional: true + }, type: 'integer', default: '4' + }, + { + id: 'remove', + match: 'flag', + flag: '--remove' } ], description: { @@ -29,15 +42,22 @@ class shameboardCommand extends Command { } async exec(message, args) { - let shameboardChannel = message.channel.id; + if (!args.remove) { + let shameboardChannel = message.channel.id; - fs.writeFile(`./board/shame${message.guild.id}.json`, `{"shameboard": "${shameboardChannel}" , "emote": "${args.emote}", "count": "${args.count}"}`, function (err) { - if (err) { - console.log(err); - } - }); - - return message.channel.send(`This channel have been set as the shameboard with ${args.emote} with the minium of ${args.count}`); + fs.writeFile(`./board/shame${message.guild.id}.json`, `{"shameboard": "${shameboardChannel}" , "emote": "${args.emote}", "count": "${args.count}"}`, function (err) { + if (err) { + console.log(err); + } + }); + + return message.channel.send(`This channel have been set as the shameboard with ${args.emote} with the minium of ${args.count}`); + } else { + fs.unlink(`./board/shame${message.guild.id}.json`, function (err) { + if (err) return message.channel.send('There is no shameboard'); + return message.channel.send('Deleted the shameboard'); + }); + } } } diff --git a/commands/admin/slowmode.js b/commands/admin/slowmode.js index b4a3ac0..cf25c1b 100644 --- a/commands/admin/slowmode.js +++ b/commands/admin/slowmode.js @@ -3,17 +3,23 @@ const { Command } = require('discord-akairo'); class SlowmodeCommand extends Command { constructor() { super('Slowmode', { - aliases: ['slowmode', 'slow'], + aliases: ['slowmode', 'slow', 'cooldown'], category: 'admin', args: [ { id: 'slowmodeNumber', + prompt: { + start: 'what do you want the delay to be between each message?', + }, type: 'integer' }, { id: 'realtime', + prompt: { + start: 'For how long should the slowmode last?', + optional: true + }, type: 'integer', - optional: true, } ], clientPermissions: ['MANAGE_CHANNELS'], diff --git a/commands/admin/starboard.js b/commands/admin/starboard.js index 2cf61cd..38063aa 100644 --- a/commands/admin/starboard.js +++ b/commands/admin/starboard.js @@ -12,12 +12,25 @@ class StarBoardCommand extends Command { { id: 'emote', type: 'string', + prompt: { + start: 'What emote should be used to enter the shameboard?', + optional: true + }, default: '🌟' }, { id: 'count', type: 'integer', + prompt: { + start: 'How many times should that emote be reacted to enter the shameboard?', + optional: true + }, default: '4' + }, + { + id: 'remove', + match: 'flag', + flag: '--remove' } ], description: { @@ -29,15 +42,22 @@ class StarBoardCommand extends Command { } async exec(message, args) { - let starboardChannel = message.channel.id; + if (!args.remove) { + let starboardChannel = message.channel.id; - fs.writeFile(`./board/star${message.guild.id}.json`, `{"starboard": "${starboardChannel}", "emote": "${args.emote}", "count": "${args.count}"}`, function (err) { - if (err) { - console.log(err); - } - }); - - return message.channel.send(`This channel have been set as the starboard with ${args.emote} with the minium of ${args.count}`); + fs.writeFile(`./board/star${message.guild.id}.json`, `{"starboard": "${starboardChannel}", "emote": "${args.emote}", "count": "${args.count}"}`, function (err) { + if (err) { + console.log(err); + } + }); + + return message.channel.send(`This channel have been set as the starboard with ${args.emote} with the minium of ${args.count}`); + } else { + fs.unlink(`./board/star${message.guild.id}.json`, function (err) { + if (err) return message.channel.send('There is no shameboard'); + return message.channel.send('Deleted the starboard'); + }); + } } } diff --git a/commands/admin/tag.js b/commands/admin/tag.js index f6d7bc4..5dbb737 100644 --- a/commands/admin/tag.js +++ b/commands/admin/tag.js @@ -11,12 +11,18 @@ class TagCommand extends Command { args: [ { id: 'trigger', - type: 'string' + type: 'string', + prompt: { + start: 'What word or sentence should trigger it?', + } }, { id: 'response', type: 'string', - match: 'rest' + match: 'rest', + prompt: { + start: 'What word or sentence should the response be?', + } } ], channelRestriction: 'guild', diff --git a/commands/admin/unban.js b/commands/admin/unban.js index 4b209dd..aa690dc 100644 --- a/commands/admin/unban.js +++ b/commands/admin/unban.js @@ -8,7 +8,10 @@ class UnbanCommand extends Command { args: [ { id: 'member', - type: 'user' + type: 'member', + prompt: { + start: 'Wich member do you want to unban?', + } } ], clientPermissions: ['BAN_MEMBERS'], diff --git a/commands/admin/untag.js b/commands/admin/untag.js index f1a0fbf..9a29051 100644 --- a/commands/admin/untag.js +++ b/commands/admin/untag.js @@ -12,7 +12,10 @@ class UnTagCommand extends Command { { id: 'trigger', type: 'string', - match: 'rest' + match: 'rest', + prompt: { + start: 'wich tag do you want to remove?', + } } ], channelRestriction: 'guild', diff --git a/commands/admin/welcome.js b/commands/admin/welcome.js index c90db87..46460b1 100644 --- a/commands/admin/welcome.js +++ b/commands/admin/welcome.js @@ -12,7 +12,10 @@ class welcomeCommand extends Command { { id: 'message', type: 'string', - match: 'rest' + match: 'rest', + prompt: { + start: 'What message do you want to welcome peoples?', + } } ], description: { diff --git a/commands/fun/reddit.js b/commands/fun/reddit.js index bbefa24..e3d2f90 100644 --- a/commands/fun/reddit.js +++ b/commands/fun/reddit.js @@ -11,6 +11,10 @@ class RedditCommand extends Command { { id: 'sub', type: 'string', + prompt: { + start: 'What subreddit do you want to browse?', + optional: true + }, default: 'random', match: 'rest' } diff --git a/commands/fun/spb.js b/commands/fun/spb.js index 63043b3..88d416b 100644 --- a/commands/fun/spb.js +++ b/commands/fun/spb.js @@ -10,7 +10,10 @@ class spbCommand extends Command { args: [ { id: 'link', - type: 'string' + type: 'string', + prompt: { + start: 'Need a shitpostbot5000 template link!', + } } ], description: { diff --git a/commands/fun/tts/dectalk.js b/commands/fun/tts/dectalk.js index 3a731dc..9ac2503 100644 --- a/commands/fun/tts/dectalk.js +++ b/commands/fun/tts/dectalk.js @@ -12,6 +12,9 @@ class dectalkCommand extends Command { { id: 'decMessage', type: 'string', + prompt: { + start: 'Write something so i can say it back in dectalk', + }, match: 'rest' } ], diff --git a/commands/fun/tts/dectalkvc.js b/commands/fun/tts/dectalkvc.js index 6958be1..808a0f4 100644 --- a/commands/fun/tts/dectalkvc.js +++ b/commands/fun/tts/dectalkvc.js @@ -12,6 +12,9 @@ class dectalkvcCommand extends Command { { id: 'decMessage', type: 'string', + prompt: { + start: 'Write something so i can say it back in dectalk', + }, match: 'rest' } ], diff --git a/commands/fun/tts/sam.js b/commands/fun/tts/sam.js index b0e5899..1a50cb1 100644 --- a/commands/fun/tts/sam.js +++ b/commands/fun/tts/sam.js @@ -12,6 +12,9 @@ class samCommand extends Command { { id: 'samMessage', type: 'string', + prompt: { + start: 'Write something so i can say it back in sam', + }, match: 'rest' } ], diff --git a/commands/fun/tts/samvc.js b/commands/fun/tts/samvc.js index 9b74cd6..7a273e5 100644 --- a/commands/fun/tts/samvc.js +++ b/commands/fun/tts/samvc.js @@ -12,6 +12,9 @@ class samvcCommand extends Command { { id: 'samMessage', type: 'string', + prompt: { + start: 'Write something so i can say it back in sam', + }, match: 'rest' } ], diff --git a/commands/fun/tts/tts.js b/commands/fun/tts/tts.js index 070193a..006bc5e 100644 --- a/commands/fun/tts/tts.js +++ b/commands/fun/tts/tts.js @@ -13,6 +13,9 @@ class TtsCommand extends Command { { id: 'text', type: 'string', + prompt: { + start: 'Write something so i can say it back in Google tts', + }, match: 'rest' } ], diff --git a/commands/fun/tts/ttsvc.js b/commands/fun/tts/ttsvc.js index 29aaa2e..5f4c66b 100644 --- a/commands/fun/tts/ttsvc.js +++ b/commands/fun/tts/ttsvc.js @@ -14,6 +14,9 @@ class TtsvcCommand extends Command { { id: 'text', type: 'string', + prompt: { + start: 'Write something so i can say it back in Google tts', + }, match: 'rest' } ], diff --git a/commands/general/clap.js b/commands/general/clap.js index be0addc..582abd6 100644 --- a/commands/general/clap.js +++ b/commands/general/clap.js @@ -9,6 +9,9 @@ class ClapCommand extends Command { { id: 'text', type: 'string', + prompt: { + start: 'Write something so i can replace the space with 👏', + }, match: 'rest' } ], diff --git a/commands/general/emotesay.js b/commands/general/emotesay.js index b19e632..6119ce1 100644 --- a/commands/general/emotesay.js +++ b/commands/general/emotesay.js @@ -11,6 +11,9 @@ class EmotesayCommand extends Command { { id: 'text', type: 'string', + prompt: { + start: 'Write something so i can replace the space with dancing emote', + }, match: 'rest' } ], diff --git a/commands/general/say.js b/commands/general/say.js index 599a163..a76f281 100644 --- a/commands/general/say.js +++ b/commands/general/say.js @@ -11,6 +11,9 @@ class SayCommand extends Command { { id: 'text', type: 'string', + prompt: { + start: 'Write something so i can say it back', + }, match: 'rest' } ], diff --git a/commands/general/sayd.js b/commands/general/sayd.js index 6a9443c..9cccc38 100644 --- a/commands/general/sayd.js +++ b/commands/general/sayd.js @@ -11,6 +11,9 @@ class SaydCommand extends Command { { id: 'text', type: 'string', + prompt: { + start: 'Write something so i can say it back', + }, match: 'rest' } ], diff --git a/commands/general/spoiler.js b/commands/general/spoiler.js index 7433e06..b7bf45f 100644 --- a/commands/general/spoiler.js +++ b/commands/general/spoiler.js @@ -9,6 +9,9 @@ class spoilerCommand extends Command { { id: 'text', type: 'string', + prompt: { + start: 'Write something so i can say it back in spoiler', + }, match: 'rest' } ], diff --git a/commands/general/tweet.js b/commands/general/tweet.js index a4abca3..0248d58 100644 --- a/commands/general/tweet.js +++ b/commands/general/tweet.js @@ -18,6 +18,9 @@ class tweetCommand extends Command { { id: 'text', type: 'string', + prompt: { + start: 'Write something to tweet', + }, match: 'rest' } ], diff --git a/commands/utility/download.js b/commands/utility/download.js index 4937142..698e445 100644 --- a/commands/utility/download.js +++ b/commands/utility/download.js @@ -13,11 +13,14 @@ class DownloadCommand extends Command { { id: 'link', type: 'string', - default: 'https://www.youtube.com/watch?v=6n3pFFPSlW4' + prompt: { + start: 'Send the link of wich video you want to download', + } }, { id: 'alt', - type: 'bool', + match: 'flag', + flag: '--alt' } ], clientPermissions: ['ATTACH_FILES'], diff --git a/commands/utility/downloadSpoiler.js b/commands/utility/downloadSpoiler.js index 50614ed..048e26d 100644 --- a/commands/utility/downloadSpoiler.js +++ b/commands/utility/downloadSpoiler.js @@ -13,11 +13,14 @@ class DownloadspoilerCommand extends Command { { id: 'link', type: 'string', - default: 'https://www.youtube.com/watch?v=6n3pFFPSlW4' + prompt: { + start: 'Send the link of wich video you want to download', + } }, { id: 'alt', - type: 'bool', + match: 'flag', + flag: '--alt' } ], clientPermissions: ['ATTACH_FILES'], @@ -36,7 +39,7 @@ class DownloadspoilerCommand extends Command { if (link.includes('http') || link.includes('www')) { if (args.alt) { console.log('alt download!'); - fs.unlink('./SPOILER_SPOILER_video.mp4', (err) => { + fs.unlink('./SPOILER_video.mp4', (err) => { if (err); }); return youtubedl.exec(args.link, ['-o', './SPOILER_video.mp4'], {}, function(err, output) { diff --git a/commands/utility/feedback.js b/commands/utility/feedback.js index b69a0c9..2ee331c 100644 --- a/commands/utility/feedback.js +++ b/commands/utility/feedback.js @@ -11,6 +11,9 @@ class FeedbackCommand extends Command { { id: 'text', type: 'string', + prompt: { + start: 'What do you want to say to the owner?', + }, match: 'rest' } ], diff --git a/commands/utility/invite.js b/commands/utility/invite.js index 6e24432..83200db 100644 --- a/commands/utility/invite.js +++ b/commands/utility/invite.js @@ -9,8 +9,8 @@ class InviteCommand extends Command { args: [ { id: 'here', - type: 'string', - optional: true + match: 'flag', + flag: '--here' } ], description: { @@ -23,7 +23,7 @@ class InviteCommand extends Command { async exec(message, args) { let invMessage = `You can add me from here: https://discordapp.com/oauth2/authorize?client_id=${this.client.user.id}&scope=bot&permissions=0\nYou can also join my support server over here: ${supportServer} come and say hi :)`; - if (args.here == 'here') { + if (args.here) { message.channel.send(invMessage); } else { message.channel.send('Check your dm'); diff --git a/commands/utility/musicMatch.js b/commands/utility/musicMatch.js index 083beae..7e19646 100644 --- a/commands/utility/musicMatch.js +++ b/commands/utility/musicMatch.js @@ -16,6 +16,9 @@ class musicCommand extends Command { { id: 'music', type: 'string', + prompt: { + start: 'Send the link of wich video you want to know song', + }, match: 'rest' } ], diff --git a/commands/utility/play.js b/commands/utility/play.js index e642052..a147da3 100644 --- a/commands/utility/play.js +++ b/commands/utility/play.js @@ -10,6 +10,9 @@ class playCommand extends Command { { id: 'ytblink', type: 'string', + prompt: { + start: 'Send the link of wich video you want to play', + }, match: 'rest', } ], diff --git a/commands/utility/translate.js b/commands/utility/translate.js index a8b8edf..ed2c813 100644 --- a/commands/utility/translate.js +++ b/commands/utility/translate.js @@ -13,6 +13,7 @@ class TranslationCommand extends Command { id: 'language', type: ['az','ml','sq','mt','am','mk','en','mi','ar','mr','hy','mhr','af','mn','eu','de','ba','ne','be','no','bn','pa','my','pap','bg','fa','bs','pl','cy','pt','hu','ro','vi','ru','ht','ceb','gl','sr','nl','si','mrj','sk','el','sl','ka','sw','gu','su','da','tg','he','th','yi','tl','id','ta','ga','tt','it','te','is','tr','es','udm','kk','uz','kn','uk','ca','ur','ky','fi','zh','fr','ko','hi','xh','hr','km','cs','lo','sv','la','gd','lv','et','lt','eo','lb','jv','mg','ja','ms'], prompt: { + start: 'In what language do you want to translate it to', retry: 'That\'s not a valid language! try again.' }, default: 'en' diff --git a/index.js b/index.js index c587cad..8bcd5a4 100644 --- a/index.js +++ b/index.js @@ -14,6 +14,15 @@ class hahaYesClient extends AkairoClient { this.commandHandler = new CommandHandler(this, { directory: './commands/', prefix: prefix, + argumentDefaults: { + prompt: { + timeout: 'Time ran out, command has been cancelled.', + ended: 'Too many retries, command has been cancelled.', + cancel: 'Command has been cancelled.', + retries: 4, + time: 30000 + } + }, commandUtil: true, commandUtilLifetime: 60000, allowMention: true,