added prompt

This commit is contained in:
loicbersier 2019-06-23 03:41:59 +02:00
parent 32b2b7ca07
commit e5d04529e4
34 changed files with 187 additions and 35 deletions

View file

@ -9,7 +9,10 @@ class autoresponseCommand extends Command {
args: [ args: [
{ {
id: 'text', id: 'text',
type: 'string' type: 'string',
prompt: {
start: 'Do you want to **enable** or **disable** auto response?',
}
}, },
{ {
id: 'all', id: 'all',

View file

@ -8,11 +8,18 @@ class BanCommand extends Command {
args: [ args: [
{ {
id: 'member', id: 'member',
type: 'member' type: 'member',
prompt: {
start: 'Wich member do you want to ban?',
}
}, },
{ {
id: 'reasons', id: 'reasons',
type: 'string', type: 'string',
prompt: {
start: 'For what reasons?',
optional: true
},
match: 'rest' match: 'rest'
} }
], ],

View file

@ -12,6 +12,9 @@ class byeCommand extends Command {
{ {
id: 'message', id: 'message',
type: 'string', type: 'string',
prompt: {
start: 'What message should the bot say when a user leave?',
},
match: 'rest' match: 'rest'
} }
], ],

View file

@ -8,11 +8,18 @@ class KickCommand extends Command {
args: [ args: [
{ {
id: 'member', id: 'member',
type: 'member' type: 'member',
prompt: {
start: 'Wich member do you want to ban?',
}
}, },
{ {
id: 'reasons', id: 'reasons',
type: 'string', type: 'string',
prompt: {
start: 'For what reasons?',
optional: true
},
match: 'rest' match: 'rest'
} }
], ],

View file

@ -8,6 +8,9 @@ class PruneCommand extends Command {
args: [ args: [
{ {
id: 'amount', id: 'amount',
prompt: {
start: 'How many message should i delete?',
},
type: 'integer' type: 'integer'
} }
], ],

View file

@ -12,12 +12,25 @@ class shameboardCommand extends Command {
{ {
id: 'emote', id: 'emote',
type: 'string', type: 'string',
prompt: {
start: 'What emote should be used to enter the shameboard?',
optional: true
},
default: '✡' default: '✡'
}, },
{ {
id: 'count', id: 'count',
prompt: {
start: 'How many times should that emote be reacted to enter the shameboard?',
optional: true
},
type: 'integer', type: 'integer',
default: '4' default: '4'
},
{
id: 'remove',
match: 'flag',
flag: '--remove'
} }
], ],
description: { description: {
@ -29,15 +42,22 @@ class shameboardCommand extends Command {
} }
async exec(message, args) { 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) { fs.writeFile(`./board/shame${message.guild.id}.json`, `{"shameboard": "${shameboardChannel}" , "emote": "${args.emote}", "count": "${args.count}"}`, function (err) {
if (err) { if (err) {
console.log(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}`); 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');
});
}
} }
} }

View file

@ -3,17 +3,23 @@ const { Command } = require('discord-akairo');
class SlowmodeCommand extends Command { class SlowmodeCommand extends Command {
constructor() { constructor() {
super('Slowmode', { super('Slowmode', {
aliases: ['slowmode', 'slow'], aliases: ['slowmode', 'slow', 'cooldown'],
category: 'admin', category: 'admin',
args: [ args: [
{ {
id: 'slowmodeNumber', id: 'slowmodeNumber',
prompt: {
start: 'what do you want the delay to be between each message?',
},
type: 'integer' type: 'integer'
}, },
{ {
id: 'realtime', id: 'realtime',
prompt: {
start: 'For how long should the slowmode last?',
optional: true
},
type: 'integer', type: 'integer',
optional: true,
} }
], ],
clientPermissions: ['MANAGE_CHANNELS'], clientPermissions: ['MANAGE_CHANNELS'],

View file

@ -12,12 +12,25 @@ class StarBoardCommand extends Command {
{ {
id: 'emote', id: 'emote',
type: 'string', type: 'string',
prompt: {
start: 'What emote should be used to enter the shameboard?',
optional: true
},
default: '🌟' default: '🌟'
}, },
{ {
id: 'count', id: 'count',
type: 'integer', type: 'integer',
prompt: {
start: 'How many times should that emote be reacted to enter the shameboard?',
optional: true
},
default: '4' default: '4'
},
{
id: 'remove',
match: 'flag',
flag: '--remove'
} }
], ],
description: { description: {
@ -29,15 +42,22 @@ class StarBoardCommand extends Command {
} }
async exec(message, args) { 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) { fs.writeFile(`./board/star${message.guild.id}.json`, `{"starboard": "${starboardChannel}", "emote": "${args.emote}", "count": "${args.count}"}`, function (err) {
if (err) { if (err) {
console.log(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}`); 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');
});
}
} }
} }

View file

@ -11,12 +11,18 @@ class TagCommand extends Command {
args: [ args: [
{ {
id: 'trigger', id: 'trigger',
type: 'string' type: 'string',
prompt: {
start: 'What word or sentence should trigger it?',
}
}, },
{ {
id: 'response', id: 'response',
type: 'string', type: 'string',
match: 'rest' match: 'rest',
prompt: {
start: 'What word or sentence should the response be?',
}
} }
], ],
channelRestriction: 'guild', channelRestriction: 'guild',

View file

@ -8,7 +8,10 @@ class UnbanCommand extends Command {
args: [ args: [
{ {
id: 'member', id: 'member',
type: 'user' type: 'member',
prompt: {
start: 'Wich member do you want to unban?',
}
} }
], ],
clientPermissions: ['BAN_MEMBERS'], clientPermissions: ['BAN_MEMBERS'],

View file

@ -12,7 +12,10 @@ class UnTagCommand extends Command {
{ {
id: 'trigger', id: 'trigger',
type: 'string', type: 'string',
match: 'rest' match: 'rest',
prompt: {
start: 'wich tag do you want to remove?',
}
} }
], ],
channelRestriction: 'guild', channelRestriction: 'guild',

View file

@ -12,7 +12,10 @@ class welcomeCommand extends Command {
{ {
id: 'message', id: 'message',
type: 'string', type: 'string',
match: 'rest' match: 'rest',
prompt: {
start: 'What message do you want to welcome peoples?',
}
} }
], ],
description: { description: {

View file

@ -11,6 +11,10 @@ class RedditCommand extends Command {
{ {
id: 'sub', id: 'sub',
type: 'string', type: 'string',
prompt: {
start: 'What subreddit do you want to browse?',
optional: true
},
default: 'random', default: 'random',
match: 'rest' match: 'rest'
} }

View file

@ -10,7 +10,10 @@ class spbCommand extends Command {
args: [ args: [
{ {
id: 'link', id: 'link',
type: 'string' type: 'string',
prompt: {
start: 'Need a shitpostbot5000 template link!',
}
} }
], ],
description: { description: {

View file

@ -12,6 +12,9 @@ class dectalkCommand extends Command {
{ {
id: 'decMessage', id: 'decMessage',
type: 'string', type: 'string',
prompt: {
start: 'Write something so i can say it back in dectalk',
},
match: 'rest' match: 'rest'
} }
], ],

View file

@ -12,6 +12,9 @@ class dectalkvcCommand extends Command {
{ {
id: 'decMessage', id: 'decMessage',
type: 'string', type: 'string',
prompt: {
start: 'Write something so i can say it back in dectalk',
},
match: 'rest' match: 'rest'
} }
], ],

View file

@ -12,6 +12,9 @@ class samCommand extends Command {
{ {
id: 'samMessage', id: 'samMessage',
type: 'string', type: 'string',
prompt: {
start: 'Write something so i can say it back in sam',
},
match: 'rest' match: 'rest'
} }
], ],

View file

@ -12,6 +12,9 @@ class samvcCommand extends Command {
{ {
id: 'samMessage', id: 'samMessage',
type: 'string', type: 'string',
prompt: {
start: 'Write something so i can say it back in sam',
},
match: 'rest' match: 'rest'
} }
], ],

View file

@ -13,6 +13,9 @@ class TtsCommand extends Command {
{ {
id: 'text', id: 'text',
type: 'string', type: 'string',
prompt: {
start: 'Write something so i can say it back in Google tts',
},
match: 'rest' match: 'rest'
} }
], ],

View file

@ -14,6 +14,9 @@ class TtsvcCommand extends Command {
{ {
id: 'text', id: 'text',
type: 'string', type: 'string',
prompt: {
start: 'Write something so i can say it back in Google tts',
},
match: 'rest' match: 'rest'
} }
], ],

View file

@ -9,6 +9,9 @@ class ClapCommand extends Command {
{ {
id: 'text', id: 'text',
type: 'string', type: 'string',
prompt: {
start: 'Write something so i can replace the space with 👏',
},
match: 'rest' match: 'rest'
} }
], ],

View file

@ -11,6 +11,9 @@ class EmotesayCommand extends Command {
{ {
id: 'text', id: 'text',
type: 'string', type: 'string',
prompt: {
start: 'Write something so i can replace the space with dancing emote',
},
match: 'rest' match: 'rest'
} }
], ],

View file

@ -11,6 +11,9 @@ class SayCommand extends Command {
{ {
id: 'text', id: 'text',
type: 'string', type: 'string',
prompt: {
start: 'Write something so i can say it back',
},
match: 'rest' match: 'rest'
} }
], ],

View file

@ -11,6 +11,9 @@ class SaydCommand extends Command {
{ {
id: 'text', id: 'text',
type: 'string', type: 'string',
prompt: {
start: 'Write something so i can say it back',
},
match: 'rest' match: 'rest'
} }
], ],

View file

@ -9,6 +9,9 @@ class spoilerCommand extends Command {
{ {
id: 'text', id: 'text',
type: 'string', type: 'string',
prompt: {
start: 'Write something so i can say it back in spoiler',
},
match: 'rest' match: 'rest'
} }
], ],

View file

@ -18,6 +18,9 @@ class tweetCommand extends Command {
{ {
id: 'text', id: 'text',
type: 'string', type: 'string',
prompt: {
start: 'Write something to tweet',
},
match: 'rest' match: 'rest'
} }
], ],

View file

@ -13,11 +13,14 @@ class DownloadCommand extends Command {
{ {
id: 'link', id: 'link',
type: 'string', type: 'string',
default: 'https://www.youtube.com/watch?v=6n3pFFPSlW4' prompt: {
start: 'Send the link of wich video you want to download',
}
}, },
{ {
id: 'alt', id: 'alt',
type: 'bool', match: 'flag',
flag: '--alt'
} }
], ],
clientPermissions: ['ATTACH_FILES'], clientPermissions: ['ATTACH_FILES'],

View file

@ -13,11 +13,14 @@ class DownloadspoilerCommand extends Command {
{ {
id: 'link', id: 'link',
type: 'string', type: 'string',
default: 'https://www.youtube.com/watch?v=6n3pFFPSlW4' prompt: {
start: 'Send the link of wich video you want to download',
}
}, },
{ {
id: 'alt', id: 'alt',
type: 'bool', match: 'flag',
flag: '--alt'
} }
], ],
clientPermissions: ['ATTACH_FILES'], clientPermissions: ['ATTACH_FILES'],
@ -36,7 +39,7 @@ class DownloadspoilerCommand extends Command {
if (link.includes('http') || link.includes('www')) { if (link.includes('http') || link.includes('www')) {
if (args.alt) { if (args.alt) {
console.log('alt download!'); console.log('alt download!');
fs.unlink('./SPOILER_SPOILER_video.mp4', (err) => { fs.unlink('./SPOILER_video.mp4', (err) => {
if (err); if (err);
}); });
return youtubedl.exec(args.link, ['-o', './SPOILER_video.mp4'], {}, function(err, output) { return youtubedl.exec(args.link, ['-o', './SPOILER_video.mp4'], {}, function(err, output) {

View file

@ -11,6 +11,9 @@ class FeedbackCommand extends Command {
{ {
id: 'text', id: 'text',
type: 'string', type: 'string',
prompt: {
start: 'What do you want to say to the owner?',
},
match: 'rest' match: 'rest'
} }
], ],

View file

@ -9,8 +9,8 @@ class InviteCommand extends Command {
args: [ args: [
{ {
id: 'here', id: 'here',
type: 'string', match: 'flag',
optional: true flag: '--here'
} }
], ],
description: { description: {
@ -23,7 +23,7 @@ class InviteCommand extends Command {
async exec(message, args) { 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 :)`; 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); message.channel.send(invMessage);
} else { } else {
message.channel.send('Check your dm'); message.channel.send('Check your dm');

View file

@ -16,6 +16,9 @@ class musicCommand extends Command {
{ {
id: 'music', id: 'music',
type: 'string', type: 'string',
prompt: {
start: 'Send the link of wich video you want to know song',
},
match: 'rest' match: 'rest'
} }
], ],

View file

@ -10,6 +10,9 @@ class playCommand extends Command {
{ {
id: 'ytblink', id: 'ytblink',
type: 'string', type: 'string',
prompt: {
start: 'Send the link of wich video you want to play',
},
match: 'rest', match: 'rest',
} }
], ],

View file

@ -13,6 +13,7 @@ class TranslationCommand extends Command {
id: 'language', 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'], 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: { prompt: {
start: 'In what language do you want to translate it to',
retry: 'That\'s not a valid language! try again.' retry: 'That\'s not a valid language! try again.'
}, },
default: 'en' default: 'en'

View file

@ -14,6 +14,15 @@ class hahaYesClient extends AkairoClient {
this.commandHandler = new CommandHandler(this, { this.commandHandler = new CommandHandler(this, {
directory: './commands/', directory: './commands/',
prefix: prefix, 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, commandUtil: true,
commandUtilLifetime: 60000, commandUtilLifetime: 60000,
allowMention: true, allowMention: true,