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 a061606..f2d2c27 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 77bf1c0..03a68c0 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 2c45d61..d268004 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 3da9371..8c38a54 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 e202d2e..9c63f49 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 47d0b97..15d74b6 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 cf25c1b..f8789e2 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 97a4c8e..3d17c89 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 25e0bfc..fd6465d 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 65cab60..272dd92 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 e7fc033..ad011e0 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 d099328..d902bdb 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 b8f59d4..daa6191 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 f2b0367..d021853 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 89c3705..bd2bd57 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 d617392..912f9a2 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 e748cc6..08a790d 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 11dbb1b..8c9958a 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 73dd329..fe9456f 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 c95f2ce..d20f9a5 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 21e9b53..2e555a1 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 7033d78..84d7c82 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 7a273e5..890c583 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 006bc5e..5c3899c 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 d08046d..42de688 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 5ecdb0c..b1824d4 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 de7d5b1..e26d578 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 72f7a28..539fecb 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 582abd6..297aba3 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 6119ce1..cbce999 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 6d05969..31b19f2 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 b7bf45f..43662bd 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 2099ef9..095af8a 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 d92a062..57a3916 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 6658533..9797e28 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 66e1fd8..fa84f85 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 7a2c811..47b4f4a 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 2202c3f..12856f8 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 e08db20..89dbf39 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 38ca1b1..90fc3fe 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 66c3dbc..ca6ac73 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 a96233b..d171548 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 7bf2177..88b404d 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 f366cfa..793c7c5 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 defc9e4..a641e81 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 7588ec1..0d73e7f 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 796c396..133366f 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 aa56327..6f45bf2 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 9c45a41..166517f 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 81710f7..5087f2c 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 e95b26a..3cff543 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 6834fb2..ebcadeb 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 c14d152..b81a7bd 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 975afd5..082eb42 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 41656f0..0fe7788 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 ad60a01..85627fc 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 5b506a3..47f0155 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 7dcccc4..03df126 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 04b361e..c2cb276 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 415a400..f7b48eb 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 ab5b613..c30e36a 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 fea052e..dd63ebd 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 97e36dd..139a44e 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 51b955f..b805e1a 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 bb978c2..fc515eb 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 a088a01..4c2f809 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 e88231e..3575ea9 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 84b429d..470f0fa 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 9158f08..c85a753 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 4e1a945..9c6bace 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}\``);