From 0113996b80b096feca6a941145b82946725316ea Mon Sep 17 00:00:00 2001 From: loicbersier Date: Sat, 9 Nov 2019 12:04:01 +0100 Subject: [PATCH] Check for perm --- commands/admin/autoresponse.js | 1 + commands/admin/ban.js | 4 ++-- commands/admin/banword.js | 2 +- commands/admin/kick.js | 4 ++-- commands/admin/prune.js | 2 +- commands/admin/shameboard.js | 4 +--- commands/admin/slowmode.js | 4 ++-- commands/admin/starboard.js | 4 +--- commands/admin/tag.js | 1 - commands/fun/4chan.js | 1 + commands/fun/asciify.js | 1 + commands/fun/doesntexist.js | 1 + commands/fun/explosm.js | 1 + commands/fun/fakejoin.js | 1 + commands/fun/fakeleave.js | 1 + commands/fun/ib.js | 1 + commands/fun/imgur.js | 1 + commands/fun/reddit.js | 1 + commands/fun/spb.js | 1 + commands/fun/tts/dectalk.js | 1 + commands/fun/tts/dectalkvc.js | 1 + commands/fun/tts/sam.js | 1 + commands/fun/tts/samvc.js | 1 + commands/fun/tts/tts.js | 1 + commands/fun/tts/ttsvc.js | 1 + commands/fun/vidshittifier.js | 33 +++++++++++++++------------ commands/fun/ytp.js | 10 ++++---- commands/general/advice.js | 1 + commands/general/clap.js | 1 + commands/general/emotesay.js | 1 + commands/general/say.js | 1 + commands/general/spoiler.js | 1 + commands/general/tweet.js | 1 + commands/images/autocrop.js | 1 + commands/images/blur.js | 1 + commands/images/fetish.js | 1 + commands/images/gaussian.js | 1 + commands/images/god.js | 1 + commands/images/idubbbz.js | 1 + commands/images/idubbbzpaint.js | 1 + commands/images/jpegify.js | 1 + commands/images/like.js | 1 + commands/images/meme.js | 1 + commands/images/mirror.js | 1 + commands/images/nolight.js | 1 + commands/images/paint.js | 1 + commands/images/rotate.js | 1 + commands/images/ugly.js | 1 + commands/minigame/borgar.js | 1 + commands/minigame/guess.js | 1 + commands/utility/about.js | 1 + commands/utility/avatar.js | 1 + commands/utility/donate.js | 1 + commands/utility/donator.js | 1 + commands/utility/download.js | 11 +++++---- commands/utility/feedback.js | 2 ++ commands/utility/gif2vid.js | 1 + commands/utility/invite.js | 1 + commands/utility/ping.js | 1 + commands/utility/play.js | 1 + commands/utility/seebannedword.js | 1 + commands/utility/seetag.js | 1 + commands/utility/server.js | 1 + commands/utility/serverIcon.js | 1 + commands/utility/stats.js | 1 + commands/utility/strawpoll.js | 1 + commands/utility/translate.js | 1 + commands/utility/updoot.js | 1 + commands/utility/vid2gif.js | 1 + event/listeners/missingPermissions.js | 2 ++ 70 files changed, 102 insertions(+), 38 deletions(-) diff --git a/commands/admin/autoresponse.js b/commands/admin/autoresponse.js index a0616061..f2d2c273 100644 --- a/commands/admin/autoresponse.js +++ b/commands/admin/autoresponse.js @@ -19,6 +19,7 @@ class autoresponseCommand extends Command { type: 'string' } ], + clientPermissions: ['SEND_MESSAGES'], userPermissions: ['MANAGE_MESSAGES'], channelRestriction: 'guild', description: { diff --git a/commands/admin/ban.js b/commands/admin/ban.js index 77bf1c0a..03a68c03 100644 --- a/commands/admin/ban.js +++ b/commands/admin/ban.js @@ -23,12 +23,12 @@ class BanCommand extends Command { match: 'rest' } ], - clientPermissions: ['BAN_MEMBERS'], + clientPermissions: ['BAN_MEMBERS', 'SEND_MESSAGES'], userPermissions: ['BAN_MEMBERS'], channelRestriction: 'guild', description: { content: 'Ban user', - usage: '[@user]', + usage: '[@user] [reason]', examples: ['@user big dumb dumb'] } }); diff --git a/commands/admin/banword.js b/commands/admin/banword.js index 2c45d61b..d268004a 100644 --- a/commands/admin/banword.js +++ b/commands/admin/banword.js @@ -7,7 +7,7 @@ class BannedWordsCommand extends Command { aliases: ['bannedword', 'banword'], category: 'admin', userPermissions: ['MANAGE_MESSAGES'], - clientPermissions: ['MANAGE_MESSAGES'], + clientPermissions: ['MANAGE_MESSAGES', 'SEND_MESSAGES'], args: [ { id: 'word', diff --git a/commands/admin/kick.js b/commands/admin/kick.js index 3da9371f..8c38a54b 100644 --- a/commands/admin/kick.js +++ b/commands/admin/kick.js @@ -23,12 +23,12 @@ class KickCommand extends Command { match: 'rest' } ], - clientPermissions: ['KICK_MEMBERS'], + clientPermissions: ['KICK_MEMBERS', 'SEND_MESSAGES'], userPermissions: ['KICK_MEMBERS'], channelRestriction: 'guild', description: { content: 'Kick user', - usage: '[@user]', + usage: '[@user] [reason]', examples: ['@user big dumb dumb'] } }); diff --git a/commands/admin/prune.js b/commands/admin/prune.js index e202d2e4..9c63f493 100644 --- a/commands/admin/prune.js +++ b/commands/admin/prune.js @@ -14,7 +14,7 @@ class PruneCommand extends Command { type: 'integer' } ], - clientPermissions: ['MANAGE_MESSAGES'], + clientPermissions: ['MANAGE_MESSAGES', 'SEND_MESSAGES'], userPermissions: ['MANAGE_MESSAGES'], channelRestriction: 'guild', description: { diff --git a/commands/admin/shameboard.js b/commands/admin/shameboard.js index 47d0b976..15d74b6a 100644 --- a/commands/admin/shameboard.js +++ b/commands/admin/shameboard.js @@ -14,9 +14,7 @@ class shameboardCommand extends Command { type: 'string', prompt: { start: 'What emote should be used to enter the shameboard?', - optional: true }, - default: '✡' }, { id: 'count', @@ -34,7 +32,7 @@ class shameboardCommand extends Command { } ], description: { - content: 'Set shameobard --remove to remove the shameboard', + content: 'Set shameobard in the current channel. --remove to remove the shameboard', usage: '[emote] [minimum number required to enter shameboard]', examples: [''] } diff --git a/commands/admin/slowmode.js b/commands/admin/slowmode.js index cf25c1bb..f8789e2a 100644 --- a/commands/admin/slowmode.js +++ b/commands/admin/slowmode.js @@ -27,8 +27,8 @@ class SlowmodeCommand extends Command { channelRestriction: 'guild', description: { content: 'Put a channel in slowmode', - usage: '[1-120 slowmode] [time it stays on]', - examples: ['267065637183029248'] + usage: '[1-120 slowmode] [Number of minutes the slowmode stay active]', + examples: ['5 60'] } }); } diff --git a/commands/admin/starboard.js b/commands/admin/starboard.js index 97a4c8ee..3d17c895 100644 --- a/commands/admin/starboard.js +++ b/commands/admin/starboard.js @@ -14,9 +14,7 @@ class StarBoardCommand extends Command { type: 'string', prompt: { start: 'What emote should be used to enter the shameboard?', - optional: true }, - default: '🌟' }, { id: 'count', @@ -34,7 +32,7 @@ class StarBoardCommand extends Command { } ], description: { - content: 'Set starboard --remove to remove the starboard', + content: 'Set starboard to the current channel. --remove to remove the starboard', usage: '[emote] [minimum number required to enter starboard]', examples: [''] } diff --git a/commands/admin/tag.js b/commands/admin/tag.js index 25e0bfc9..fd6465d2 100644 --- a/commands/admin/tag.js +++ b/commands/admin/tag.js @@ -22,7 +22,6 @@ class TagCommand extends Command { match: 'rest', prompt: { start: 'What word or sentence should the response be?', - optional: true } }, { diff --git a/commands/fun/4chan.js b/commands/fun/4chan.js index 65cab60b..272dd922 100644 --- a/commands/fun/4chan.js +++ b/commands/fun/4chan.js @@ -8,6 +8,7 @@ class FourchanCommand extends Command { constructor() { super('4chan', { aliases: ['4chan'], + clientPermissions: ['EMBED_LINKS', 'SEND_MESSAGES'], category: 'fun', args: [ diff --git a/commands/fun/asciify.js b/commands/fun/asciify.js index e7fc0337..ad011e01 100644 --- a/commands/fun/asciify.js +++ b/commands/fun/asciify.js @@ -13,6 +13,7 @@ class asciifyCommand extends Command { super('asciify', { aliases: ['asciify'], category: 'fun', + clientPermissions: ['SEND_MESSAGES'], cooldown: 600000, ratelimit: 2, description: { diff --git a/commands/fun/doesntexist.js b/commands/fun/doesntexist.js index d099328d..d902bdb6 100644 --- a/commands/fun/doesntexist.js +++ b/commands/fun/doesntexist.js @@ -7,6 +7,7 @@ class dosentexistCommand extends Command { super('dosentexist', { aliases: ['doesntexist', 'thispersondoesnotexist', 'de'], category: 'fun', + clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], description: { content: 'Send images from thispersondoesnotexist.com', usage: '', diff --git a/commands/fun/explosm.js b/commands/fun/explosm.js index b8f59d49..daa61910 100644 --- a/commands/fun/explosm.js +++ b/commands/fun/explosm.js @@ -6,6 +6,7 @@ class explosmCommand extends Command { super('explosm', { aliases: ['explosm', 'rcg'], category: 'fun', + clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], description: { content: 'Comic randomly generated from http://explosm.net/rcg', usage: '', diff --git a/commands/fun/fakejoin.js b/commands/fun/fakejoin.js index f2b0367c..d0218530 100644 --- a/commands/fun/fakejoin.js +++ b/commands/fun/fakejoin.js @@ -8,6 +8,7 @@ class fakejoinCommand extends Command { aliases: ['fakejoin'], category: 'admin', channelRestriction: 'guild', + clientPermissions: ['SEND_MESSAGES'], args: [ { id: 'member', diff --git a/commands/fun/fakeleave.js b/commands/fun/fakeleave.js index 89c3705a..bd2bd57a 100644 --- a/commands/fun/fakeleave.js +++ b/commands/fun/fakeleave.js @@ -8,6 +8,7 @@ class fakeleaveCommand extends Command { aliases: ['fakeleave'], category: 'admin', channelRestriction: 'guild', + clientPermissions: ['SEND_MESSAGES'], args: [ { id: 'member', diff --git a/commands/fun/ib.js b/commands/fun/ib.js index d6173923..912f9a27 100644 --- a/commands/fun/ib.js +++ b/commands/fun/ib.js @@ -6,6 +6,7 @@ class InspiroBotCommand extends Command { super('InspiroBot', { aliases: ['inspirobot', 'ib'], category: 'fun', + clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], description: { content: 'Send images from Inspirobot', usage: '', diff --git a/commands/fun/imgur.js b/commands/fun/imgur.js index e748cc66..08a790d3 100644 --- a/commands/fun/imgur.js +++ b/commands/fun/imgur.js @@ -6,6 +6,7 @@ class ImgurCommand extends Command { super('imgur', { aliases: ['imgur', 'badmeme'], category: 'fun', + clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'], description: { content: 'Send some random images from imgur', usage: '', diff --git a/commands/fun/reddit.js b/commands/fun/reddit.js index 11dbb1be..8c9958ae 100644 --- a/commands/fun/reddit.js +++ b/commands/fun/reddit.js @@ -7,6 +7,7 @@ class RedditCommand extends Command { super('reddit', { aliases: ['reddit'], category: 'fun', + clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'], args: [ { id: 'sub', diff --git a/commands/fun/spb.js b/commands/fun/spb.js index 73dd329e..fe9456f7 100644 --- a/commands/fun/spb.js +++ b/commands/fun/spb.js @@ -8,6 +8,7 @@ class spbCommand extends Command { super('spb', { aliases: ['spb'], category: 'fun', + clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], args: [ { id: 'link', diff --git a/commands/fun/tts/dectalk.js b/commands/fun/tts/dectalk.js index c95f2ce5..d20f9a56 100644 --- a/commands/fun/tts/dectalk.js +++ b/commands/fun/tts/dectalk.js @@ -8,6 +8,7 @@ class dectalkCommand extends Command { super('dectalk', { aliases: ['dectalk', 'dec'], category: 'fun', + clientPermissions: ['ATTACH_FILES'], args: [ { id: 'decMessage', diff --git a/commands/fun/tts/dectalkvc.js b/commands/fun/tts/dectalkvc.js index 21e9b53b..2e555a17 100644 --- a/commands/fun/tts/dectalkvc.js +++ b/commands/fun/tts/dectalkvc.js @@ -8,6 +8,7 @@ class dectalkvcCommand extends Command { super('dectalkvc', { aliases: ['dectalkvc', 'decvc'], category: 'fun', + clientPermissions: ['ATTACH_FILES'], args: [ { id: 'decMessage', diff --git a/commands/fun/tts/sam.js b/commands/fun/tts/sam.js index 7033d781..84d7c821 100644 --- a/commands/fun/tts/sam.js +++ b/commands/fun/tts/sam.js @@ -8,6 +8,7 @@ class samCommand extends Command { super('sam', { aliases: ['sam'], category: 'fun', + clientPermissions: ['ATTACH_FILES'], args: [ { id: 'samMessage', diff --git a/commands/fun/tts/samvc.js b/commands/fun/tts/samvc.js index 7a273e56..890c583c 100644 --- a/commands/fun/tts/samvc.js +++ b/commands/fun/tts/samvc.js @@ -8,6 +8,7 @@ class samvcCommand extends Command { super('samvc', { aliases: ['samvc'], category: 'fun', + clientPermissions: ['ATTACH_FILES'], args: [ { id: 'samMessage', diff --git a/commands/fun/tts/tts.js b/commands/fun/tts/tts.js index 006bc5ec..5c3899cd 100644 --- a/commands/fun/tts/tts.js +++ b/commands/fun/tts/tts.js @@ -9,6 +9,7 @@ class TtsCommand extends Command { super('tts', { aliases: ['tts'], category: 'fun', + clientPermissions: ['ATTACH_FILES'], args: [ { id: 'text', diff --git a/commands/fun/tts/ttsvc.js b/commands/fun/tts/ttsvc.js index d08046d3..42de688a 100644 --- a/commands/fun/tts/ttsvc.js +++ b/commands/fun/tts/ttsvc.js @@ -9,6 +9,7 @@ class TtsvcCommand extends Command { super('ttsvc', { aliases: ['ttsvc'], category: 'fun', + clientPermissions: ['ATTACH_FILES'], args: [ { id: 'text', diff --git a/commands/fun/vidshittifier.js b/commands/fun/vidshittifier.js index 5ecdb0cf..b1824d49 100644 --- a/commands/fun/vidshittifier.js +++ b/commands/fun/vidshittifier.js @@ -9,6 +9,7 @@ class vidshittifierCommand extends Command { super('vidshittifier', { aliases: ['vidshittifier', 'vs', 'shittifier', 'vid2shit', 'v2s'], category: 'fun', + clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], args: [ { id: 'link', @@ -36,6 +37,7 @@ class vidshittifierCommand extends Command { } let input = `${os.tmpdir()}/${message.id}.mp4`; + let input2 = `${os.tmpdir()}/tmp${message.id}.mp4`; let output = `${os.tmpdir()}/Shittified${message.id}.mp4`; let compression; @@ -44,13 +46,11 @@ class vidshittifierCommand extends Command { if (args.compression == 1) { compression = '50k'; audioCompression = '100k'; - } else if (args.compression == 2) { + } else { compression = '30k'; audioCompression = '60k'; - } else { - compression = '10k'; - audioCompression = '20k'; } + let option = `-b:v ${compression} -b:a ${audioCompression}`; let loadingmsg = await message.channel.send('Processing '); @@ -70,21 +70,26 @@ class vidshittifierCommand extends Command { } function shittifie() { - exec(`ffmpeg -i ${input} ${option} -vcodec libx264 -r 15 -f mp4 ${output}`) + // reduce video resolution + exec(`ffmpeg -i ${input} -vf "scale=iw/4:ih/4" ${input2}`) .then(() => { - loadingmsg.delete(); - message.delete(); - return message.channel.send({files: [output]}) + // upscale video and change bitrate + exec(`ffmpeg -i ${input2} ${option} -vf "scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2" -vcodec libx264 -r 15 -f mp4 ${output}`) + .then(() => { + loadingmsg.delete(); + message.delete(); + return message.channel.send({files: [output]}) + .catch(err => { + console.error(err); + loadingmsg.delete(); + return message.channel.send('On no! an error just occured! perhaps the file is too big?'); + }); + }) .catch(err => { console.error(err); loadingmsg.delete(); - return message.channel.send('On no! an error just occured! perhaps the file is too big?'); + return message.channel.send('On no! an error just occured! Im gonna be honest with you, i don\'t know what caused it yet! but worry not! my owner will look into it soon!'); }); - }) - .catch(err => { - console.error(err); - loadingmsg.delete(); - return message.channel.send('On no! an error just occured! Im gonna be honest with you, i don\'t know what caused it yet! but worry not! my owner will look into it soon!'); }); } } diff --git a/commands/fun/ytp.js b/commands/fun/ytp.js index de7d5b1d..e26d578c 100644 --- a/commands/fun/ytp.js +++ b/commands/fun/ytp.js @@ -10,6 +10,7 @@ class ytpCommand extends Command { super('ytp', { aliases: ['ytp', 'ytpplus', 'ytp+'], category: 'fun', + clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], args: [ { id: 'add', @@ -114,7 +115,7 @@ class ytpCommand extends Command { let options = { - debug: false, // Better set this to false to avoid flood in console + debug: true, // Better set this to false to avoid flood in console MAX_STREAM_DURATION: Math.floor((Math.random() * 3) + 1), // Random duration of video clip sources: './asset/ytp/sources/', sounds: './asset/ytp/sounds/', @@ -122,7 +123,7 @@ class ytpCommand extends Command { resources: './asset/ytp/resources/', temp: os.tmpdir(), sourceList: asset, - outro: './asset/ytp/outro.mp4', // Need an outro or it won't work + //outro: './asset/ytp/outro.mp4', // Need an outro or it won't work OUTPUT_FILE: `${os.tmpdir()}/${message.id}_YTP.mp4`, MAX_CLIPS: MAX_CLIPS, transitions: true, @@ -137,7 +138,7 @@ class ytpCommand extends Command { effect_SpeedUp: true, effect_SlowDown: true, effect_Dance: true, - effect_Squidward: false // Not yet implemented + effect_Squidward: true // Not yet implemented } }; @@ -145,7 +146,8 @@ class ytpCommand extends Command { .then(() => { loadingmsg.delete(); return message.reply('Here is your YTP!', {files: [`${os.tmpdir()}/${message.id}_YTP.mp4`]}) - .catch(() => { + .catch(err => { + console.error(err); return message.channel.send('Whoops, look like the vid might be too big for discord, my bad, please try again'); }); }) diff --git a/commands/general/advice.js b/commands/general/advice.js index 72f7a288..539fecbe 100644 --- a/commands/general/advice.js +++ b/commands/general/advice.js @@ -7,6 +7,7 @@ class AdviceCommand extends Command { super('advice', { aliases: ['advice'], category: 'general', + clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'], description: { content: 'Send some random advices', usage: '', diff --git a/commands/general/clap.js b/commands/general/clap.js index 582abd6f..297aba3f 100644 --- a/commands/general/clap.js +++ b/commands/general/clap.js @@ -5,6 +5,7 @@ class ClapCommand extends Command { super('clap', { aliases: ['clap'], category: 'general', + clientPermissions: ['SEND_MESSAGES'], args: [ { id: 'text', diff --git a/commands/general/emotesay.js b/commands/general/emotesay.js index 6119ce1a..cbce9990 100644 --- a/commands/general/emotesay.js +++ b/commands/general/emotesay.js @@ -7,6 +7,7 @@ class EmotesayCommand extends Command { super('emotesay', { aliases: ['emotesay', 'esay'], category: 'general', + clientPermissions: ['SEND_MESSAGES'], args: [ { id: 'text', diff --git a/commands/general/say.js b/commands/general/say.js index 6d059690..31b19f26 100644 --- a/commands/general/say.js +++ b/commands/general/say.js @@ -7,6 +7,7 @@ class SayCommand extends Command { super('say', { aliases: ['say'], category: 'general', + clientPermissions: ['SEND_MESSAGES'], args: [ { id: 'text', diff --git a/commands/general/spoiler.js b/commands/general/spoiler.js index b7bf45f9..43662bd7 100644 --- a/commands/general/spoiler.js +++ b/commands/general/spoiler.js @@ -5,6 +5,7 @@ class spoilerCommand extends Command { super('spoiler', { aliases: ['spoiler'], category: 'general', + clientPermissions: ['SEND_MESSAGES'], args: [ { id: 'text', diff --git a/commands/general/tweet.js b/commands/general/tweet.js index 2099ef9e..095af8ac 100644 --- a/commands/general/tweet.js +++ b/commands/general/tweet.js @@ -12,6 +12,7 @@ class tweetCommand extends Command { super('tweet', { aliases: ['tweet'], category: 'general', + clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'], cooldown: 3600000, ratelimit: 3, args: [ diff --git a/commands/images/autocrop.js b/commands/images/autocrop.js index d92a062a..57a39161 100644 --- a/commands/images/autocrop.js +++ b/commands/images/autocrop.js @@ -7,6 +7,7 @@ class autocropCommand extends Command { super('autocrop', { aliases: ['autocrop', 'crop'], category: 'images', + clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], args: [ { id: 'link', diff --git a/commands/images/blur.js b/commands/images/blur.js index 66585332..9797e284 100644 --- a/commands/images/blur.js +++ b/commands/images/blur.js @@ -7,6 +7,7 @@ class blurCommand extends Command { super('blur', { aliases: ['blur'], category: 'images', + clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], args: [ { id: 'link', diff --git a/commands/images/fetish.js b/commands/images/fetish.js index 66e1fd8b..fa84f856 100644 --- a/commands/images/fetish.js +++ b/commands/images/fetish.js @@ -7,6 +7,7 @@ class FetishCommand extends Command { super('fetish', { aliases: ['fetish'], category: 'images', + clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], args: [ { id: 'image', diff --git a/commands/images/gaussian.js b/commands/images/gaussian.js index 7a2c811d..47b4f4a9 100644 --- a/commands/images/gaussian.js +++ b/commands/images/gaussian.js @@ -7,6 +7,7 @@ class gaussianCommand extends Command { super('gaussian', { aliases: ['gaussian'], category: 'images', + clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], args: [ { id: 'link', diff --git a/commands/images/god.js b/commands/images/god.js index 2202c3ff..12856f89 100644 --- a/commands/images/god.js +++ b/commands/images/god.js @@ -8,6 +8,7 @@ class GodCommand extends Command { super('god', { aliases: ['god'], category: 'images', + clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], args: [ { id: 'image', diff --git a/commands/images/idubbbz.js b/commands/images/idubbbz.js index e08db202..89dbf39e 100644 --- a/commands/images/idubbbz.js +++ b/commands/images/idubbbz.js @@ -7,6 +7,7 @@ class IdubbbzCommand extends Command { super('idubbbz', { aliases: ['idubbbz', 'edups'], category: 'images', + clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], args: [ { id: 'text', diff --git a/commands/images/idubbbzpaint.js b/commands/images/idubbbzpaint.js index 38ca1b19..90fc3fe1 100644 --- a/commands/images/idubbbzpaint.js +++ b/commands/images/idubbbzpaint.js @@ -7,6 +7,7 @@ class IdubbbzPaintCommand extends Command { super('idubbbzpaint', { aliases: ['idubbbzpaint', 'edupspaint'], category: 'images', + clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], args: [ { id: 'text', diff --git a/commands/images/jpegify.js b/commands/images/jpegify.js index 66c3dbc0..ca6ac73d 100644 --- a/commands/images/jpegify.js +++ b/commands/images/jpegify.js @@ -7,6 +7,7 @@ class jpegifyCommand extends Command { super('jpegify', { aliases: ['jpegify'], category: 'images', + clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], args: [ { id: 'link', diff --git a/commands/images/like.js b/commands/images/like.js index a96233b2..d1715483 100644 --- a/commands/images/like.js +++ b/commands/images/like.js @@ -7,6 +7,7 @@ class LikeCommand extends Command { super('like', { aliases: ['like'], category: 'images', + clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], args: [ { id: 'image', diff --git a/commands/images/meme.js b/commands/images/meme.js index 7bf2177b..88b404d0 100644 --- a/commands/images/meme.js +++ b/commands/images/meme.js @@ -9,6 +9,7 @@ class memeCommand extends Command { super('meme', { aliases: ['meme', 'impact'], category: 'images', + clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], args: [ { id: 'link', diff --git a/commands/images/mirror.js b/commands/images/mirror.js index f366cfa0..793c7c5b 100644 --- a/commands/images/mirror.js +++ b/commands/images/mirror.js @@ -7,6 +7,7 @@ class mirrorCommand extends Command { super('mirror', { aliases: ['mirror', 'flip'], category: 'images', + clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], args: [ { id: 'link', diff --git a/commands/images/nolight.js b/commands/images/nolight.js index defc9e47..a641e81d 100644 --- a/commands/images/nolight.js +++ b/commands/images/nolight.js @@ -11,6 +11,7 @@ class nolightCommand extends Command { super('nolight', { aliases: ['nolight', 'nl'], category: 'images', + clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], args: [ { id: 'text', diff --git a/commands/images/paint.js b/commands/images/paint.js index 7588ec1e..0d73e7f7 100644 --- a/commands/images/paint.js +++ b/commands/images/paint.js @@ -7,6 +7,7 @@ class paintCommand extends Command { super('paint', { aliases: ['paint'], category: 'images', + clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], args: [ { id: 'image', diff --git a/commands/images/rotate.js b/commands/images/rotate.js index 796c3960..133366f6 100644 --- a/commands/images/rotate.js +++ b/commands/images/rotate.js @@ -7,6 +7,7 @@ class rotateCommand extends Command { super('rotate', { aliases: ['rotate'], category: 'images', + clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], args: [ { id: 'link', diff --git a/commands/images/ugly.js b/commands/images/ugly.js index aa56327d..6f45bf25 100644 --- a/commands/images/ugly.js +++ b/commands/images/ugly.js @@ -7,6 +7,7 @@ class UglyCommand extends Command { super('ugly', { aliases: ['ugly'], category: 'images', + clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], args: [ { id: 'image', diff --git a/commands/minigame/borgar.js b/commands/minigame/borgar.js index 9c45a410..166517f5 100644 --- a/commands/minigame/borgar.js +++ b/commands/minigame/borgar.js @@ -10,6 +10,7 @@ class borgarCommand extends Command { super('borgar', { aliases: ['borgar', 'hamburgor', 'hamborgar', 'burger', 'hamburger', 'borger'], category: 'minigame', + clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'], description: { content: 'Make amborgar,,,,,,,,,, ( MINI GAME VERY WIP, LEVEL/XP SYSTEM MIGHT BE BULLSHIT )', usage: '', diff --git a/commands/minigame/guess.js b/commands/minigame/guess.js index 81710f7c..5087f2c6 100644 --- a/commands/minigame/guess.js +++ b/commands/minigame/guess.js @@ -7,6 +7,7 @@ class guessCommand extends Command { super('guess', { aliases: ['guess'], category: 'minigame', + clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'], args: [ { id: 'leaderboard', diff --git a/commands/utility/about.js b/commands/utility/about.js index e95b26a0..3cff543a 100644 --- a/commands/utility/about.js +++ b/commands/utility/about.js @@ -8,6 +8,7 @@ class aboutCommand extends Command { super('about', { aliases: ['about', 'credit'], category: 'utility', + clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'], description: { content: 'About me ( the bot )', usage: '', diff --git a/commands/utility/avatar.js b/commands/utility/avatar.js index 6834fb29..ebcadebc 100644 --- a/commands/utility/avatar.js +++ b/commands/utility/avatar.js @@ -5,6 +5,7 @@ class AvatarCommand extends Command { super('avatar', { aliases: ['avatar', 'avy'], category: 'utility', + clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], args: [ { id: 'user', diff --git a/commands/utility/donate.js b/commands/utility/donate.js index c14d152e..b81a7bd6 100644 --- a/commands/utility/donate.js +++ b/commands/utility/donate.js @@ -6,6 +6,7 @@ class donateCommand extends Command { super('donate', { aliases: ['donate', 'donation', 'giveallmymoney', 'givemoney'], category: 'utility', + clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'], description: { content: 'Send donate link for the bot and support server', usage: '', diff --git a/commands/utility/donator.js b/commands/utility/donator.js index 975afd56..082eb42e 100644 --- a/commands/utility/donator.js +++ b/commands/utility/donator.js @@ -6,6 +6,7 @@ class donatorCommand extends Command { super('donator', { aliases: ['donator'], category: 'utility', + clientPermissions: ['SEND_MESSAGES'], description: { content: 'All the people who donated for this bot <3', usage: '', diff --git a/commands/utility/download.js b/commands/utility/download.js index 41656f0a..0fe7788b 100644 --- a/commands/utility/download.js +++ b/commands/utility/download.js @@ -10,6 +10,7 @@ class DownloadCommand extends Command { super('download', { aliases: ['download', 'dl'], category: 'utility', + clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS', 'ATTACH_FILES'], args: [ { id: 'link', @@ -29,7 +30,6 @@ class DownloadCommand extends Command { flag: ['--spoil', '--spoiler', '-s'] } ], - clientPermissions: ['ATTACH_FILES'], description: { content: 'Download videos from different website from the link you provided, use "-s" to make the vid a spoiler', usage: '[link] [caption]', @@ -101,9 +101,9 @@ class DownloadCommand extends Command { const Embed = new MessageEmbed() .setColor(message.member.displayHexColor) - .setTitle(`Downloaded by ${message.author.username}`) + .setAuthor(`Downloaded by ${message.author.username}`, message.author.displayAvatarURL(), link) .setDescription(args.caption) - .setURL(link); + .setFooter('You can get the original video by clicking on the "downloaded by" message!'); return message.channel.send({embed: Embed, files: [`${os.tmpdir()}/${fileName}compressed.mp4`]}) .catch(err => { @@ -118,9 +118,10 @@ class DownloadCommand extends Command { const Embed = new MessageEmbed() .setColor(message.member.displayHexColor) - .setTitle(`Downloaded by ${message.author.username}`) + .setAuthor(`Downloaded by ${message.author.username}`, message.author.displayAvatarURL(), link) .setDescription(args.caption) - .setURL(link); + .setFooter('You can get the original video by clicking on the "downloaded by" message!'); + return message.channel.send({embed: Embed, files: [`${os.tmpdir()}/${fileName}.mp4`]}) .catch(err => { diff --git a/commands/utility/feedback.js b/commands/utility/feedback.js index ad60a016..85627fcc 100644 --- a/commands/utility/feedback.js +++ b/commands/utility/feedback.js @@ -7,6 +7,7 @@ class FeedbackCommand extends Command { super('feedback', { aliases: ['feedback'], category: 'utility', + clientPermissions: ['SEND_MESSAGES'], args: [ { id: 'text', @@ -40,6 +41,7 @@ class FeedbackCommand extends Command { .addField('Feedback', args.text) .setTimestamp(); channel.send({embed: Embed}); + message.channel.send('Your feedback has been sent!'); } } diff --git a/commands/utility/gif2vid.js b/commands/utility/gif2vid.js index 5b506a31..47f0155b 100644 --- a/commands/utility/gif2vid.js +++ b/commands/utility/gif2vid.js @@ -10,6 +10,7 @@ class gif2vidCommand extends Command { super('gif2vid', { aliases: ['gif2vid', 'g2v', 'gv'], category: 'utility', + clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], args: [ { id: 'vid', diff --git a/commands/utility/invite.js b/commands/utility/invite.js index 7dcccc42..03df126c 100644 --- a/commands/utility/invite.js +++ b/commands/utility/invite.js @@ -6,6 +6,7 @@ class InviteCommand extends Command { super('invite', { aliases: ['invite'], category: 'utility', + clientPermissions: ['SEND_MESSAGES'], args: [ { id: 'here', diff --git a/commands/utility/ping.js b/commands/utility/ping.js index 04b361e5..c2cb2766 100644 --- a/commands/utility/ping.js +++ b/commands/utility/ping.js @@ -11,6 +11,7 @@ class PingCommand extends Command { type: 'string', } ], + clientPermissions: ['SEND_MESSAGES'], description: { content: 'Ping the bot', usage: '', diff --git a/commands/utility/play.js b/commands/utility/play.js index 415a4007..f7b48eba 100644 --- a/commands/utility/play.js +++ b/commands/utility/play.js @@ -6,6 +6,7 @@ class playCommand extends Command { super('play', { aliases: ['play'], category: 'utility', + clientPermissions: ['SEND_MESSAGES', 'SPEAK'], args: [ { id: 'ytblink', diff --git a/commands/utility/seebannedword.js b/commands/utility/seebannedword.js index ab5b6132..c30e36a1 100644 --- a/commands/utility/seebannedword.js +++ b/commands/utility/seebannedword.js @@ -8,6 +8,7 @@ class seebannedwordCommand extends Command { super('seebannedword', { aliases: ['seebannedword', 'seeban', 'seebanword'], category: 'utility', + clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'], channelRestriction: 'guild', description: { content: 'Show the list of banned word', diff --git a/commands/utility/seetag.js b/commands/utility/seetag.js index fea052ed..dd63ebd5 100644 --- a/commands/utility/seetag.js +++ b/commands/utility/seetag.js @@ -10,6 +10,7 @@ class seetagCommand extends Command { super('taglist', { aliases: ['seetag', 'taglist', 'tags'], category: 'utility', + clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'], channelRestriction: 'guild', args: [ { diff --git a/commands/utility/server.js b/commands/utility/server.js index 97e36dd0..139a44e5 100644 --- a/commands/utility/server.js +++ b/commands/utility/server.js @@ -6,6 +6,7 @@ class ServerCommand extends Command { super('server', { aliases: ['server', 'serverinfo'], category: 'utility', + clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'], channelRestriction: 'guild', description: { content: 'Show info about the server', diff --git a/commands/utility/serverIcon.js b/commands/utility/serverIcon.js index 51b955fd..b805e1a9 100644 --- a/commands/utility/serverIcon.js +++ b/commands/utility/serverIcon.js @@ -5,6 +5,7 @@ class serverIconCommand extends Command { super('serverIcon', { aliases: ['serverIcon'], category: 'utility', + clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], args: [ { id: 'serverid', diff --git a/commands/utility/stats.js b/commands/utility/stats.js index bb978c2a..fc515ebd 100644 --- a/commands/utility/stats.js +++ b/commands/utility/stats.js @@ -9,6 +9,7 @@ class StatsCommand extends Command { super('stats', { aliases: ['stats'], category: 'utility', + clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'], description: { content: 'Show some stats about the bot', usage: '', diff --git a/commands/utility/strawpoll.js b/commands/utility/strawpoll.js index a088a01d..4c2f809b 100644 --- a/commands/utility/strawpoll.js +++ b/commands/utility/strawpoll.js @@ -6,6 +6,7 @@ class SayCommand extends Command { super('strawpoll', { aliases: ['strawpoll', 'poll'], category: 'general', + clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'], args: [ { id: 'title', diff --git a/commands/utility/translate.js b/commands/utility/translate.js index e88231e7..3575ea96 100644 --- a/commands/utility/translate.js +++ b/commands/utility/translate.js @@ -8,6 +8,7 @@ class TranslationCommand extends Command { super('translation', { aliases: ['translation', 'trn'], category: 'utility', + clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'], args: [ { id: 'language', diff --git a/commands/utility/updoot.js b/commands/utility/updoot.js index 84b429d3..470f0fad 100644 --- a/commands/utility/updoot.js +++ b/commands/utility/updoot.js @@ -7,6 +7,7 @@ class UpdootCommand extends Command { aliases: ['updoot', 'upvote', 'vote'], category: 'utility', channelRestriction: 'guild', + clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'], description: { content: 'Send a link to vote for my bot', usage: '', diff --git a/commands/utility/vid2gif.js b/commands/utility/vid2gif.js index 9158f081..c85a753e 100644 --- a/commands/utility/vid2gif.js +++ b/commands/utility/vid2gif.js @@ -10,6 +10,7 @@ class vid2gifCommand extends Command { super('vid2gif', { aliases: ['vid2gif', 'v2g', 'vg'], category: 'utility', + clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], args: [ { id: 'vid', diff --git a/event/listeners/missingPermissions.js b/event/listeners/missingPermissions.js index 4e1a945b..9c6bace1 100644 --- a/event/listeners/missingPermissions.js +++ b/event/listeners/missingPermissions.js @@ -9,6 +9,8 @@ class missingPermissionsListener extends Listener { } async exec(message, command, type, missing) { + if (missing == 'SEND_MESSAGES') return; // If bot can't send messages just do nothing + switch(type) { case 'client': message.reply(`Im missing the required permissions for this command!, \`${missing}\``);