From 3b2e3069772efd04d62cfda17d2f3b879e5923c6 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Thu, 19 Mar 2020 23:24:31 +0100 Subject: [PATCH] fix channel restriction --- commands/admin/autoresponse.js | 2 +- commands/admin/ban.js | 2 +- commands/admin/banword.js | 2 +- commands/admin/bye.js | 2 +- commands/admin/commandblock.js | 2 +- commands/admin/fakejoin.js | 2 +- commands/admin/fakeleave.js | 2 +- commands/admin/kick.js | 2 +- commands/admin/prune.js | 2 +- commands/admin/quotation.js | 2 +- commands/admin/shameboard.js | 2 +- commands/admin/slowmode.js | 2 +- commands/admin/starboard.js | 2 +- commands/admin/tag.js | 2 +- commands/admin/unban.js | 2 +- commands/admin/welcome.js | 2 +- commands/admin/whitelistword.js | 2 +- commands/owner/addDonator.js | 2 +- commands/owner/addResponse.js | 2 +- commands/owner/blacklist.js | 2 +- commands/owner/removeResponse.js | 2 +- commands/owner/serverblacklist.js | 2 +- commands/owner/twitterBlacklist.js | 2 +- commands/reserved/bsespam.js | 2 +- commands/utility/color.js | 1 + commands/utility/screenshot.js | 2 +- commands/utility/seebannedword.js | 2 +- commands/utility/seetag.js | 2 +- commands/utility/server.js | 2 +- commands/utility/serverIcon.js | 1 + commands/utility/updoot.js | 2 +- commands/utility/userInfo.js | 2 +- event/listeners/commandblocked.js | 4 ++-- 33 files changed, 34 insertions(+), 32 deletions(-) diff --git a/commands/admin/autoresponse.js b/commands/admin/autoresponse.js index 2c6e8b68..8d75ec18 100644 --- a/commands/admin/autoresponse.js +++ b/commands/admin/autoresponse.js @@ -17,7 +17,7 @@ class autoresponseCommand extends Command { ], clientPermissions: ['SEND_MESSAGES'], userPermissions: ['MANAGE_MESSAGES'], - channelRestriction: 'guild', + channel: 'guild', description: { content: 'enable/disable autoresponse', usage: '[enable/disable]', diff --git a/commands/admin/ban.js b/commands/admin/ban.js index b680a5bf..7c74c932 100644 --- a/commands/admin/ban.js +++ b/commands/admin/ban.js @@ -26,7 +26,7 @@ class BanCommand extends Command { ], clientPermissions: ['BAN_MEMBERS', 'SEND_MESSAGES'], userPermissions: ['BAN_MEMBERS'], - channelRestriction: 'guild', + channel: 'guild', description: { content: 'Ban user | For hackban precise the userid', usage: '[@user] [reason] OR [userID] [reason]', diff --git a/commands/admin/banword.js b/commands/admin/banword.js index f4c6547e..cfc361d9 100644 --- a/commands/admin/banword.js +++ b/commands/admin/banword.js @@ -25,7 +25,7 @@ class BannedWordsCommand extends Command { flag: '--removeall' } ], - channelRestriction: 'guild', + channel: 'guild', description: { content: 'Ban word on the server. use the unbanword alias to delete a banned word, unbanword alias and --removeaall to remove every banned word', usage: '[word to ban]', diff --git a/commands/admin/bye.js b/commands/admin/bye.js index 333b74dc..7e4c5bbd 100644 --- a/commands/admin/bye.js +++ b/commands/admin/bye.js @@ -6,7 +6,7 @@ class byeCommand extends Command { super('bye', { aliases: ['bye', 'leave'], category: 'admin', - channelRestriction: 'guild', + channel: 'guild', userPermissions: ['MANAGE_CHANNELS'], clientPermissions: ['SEND_MESSAGES'], args: [ diff --git a/commands/admin/commandblock.js b/commands/admin/commandblock.js index 881358b7..55dce2bc 100644 --- a/commands/admin/commandblock.js +++ b/commands/admin/commandblock.js @@ -18,7 +18,7 @@ class commandblockCommand extends Command { ], clientPermissions: ['SEND_MESSAGES'], userPermissions: ['ADMINISTRATOR'], - channelRestriction: 'guild', + channel: 'guild', description: { content: 'Block a command. Execute that command again to unblock a command', usage: '[command name]', diff --git a/commands/admin/fakejoin.js b/commands/admin/fakejoin.js index 5e1db5e2..ada83dc8 100644 --- a/commands/admin/fakejoin.js +++ b/commands/admin/fakejoin.js @@ -6,7 +6,7 @@ class fakejoinCommand extends Command { super('fakejoin', { aliases: ['fakejoin'], category: 'admin', - channelRestriction: 'guild', + channel: 'guild', clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], args: [ { diff --git a/commands/admin/fakeleave.js b/commands/admin/fakeleave.js index fdde8d93..be663019 100644 --- a/commands/admin/fakeleave.js +++ b/commands/admin/fakeleave.js @@ -6,7 +6,7 @@ class fakeleaveCommand extends Command { super('fakeleave', { aliases: ['fakeleave'], category: 'admin', - channelRestriction: 'guild', + channel: 'guild', clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], args: [ { diff --git a/commands/admin/kick.js b/commands/admin/kick.js index 022e2d38..a04901a1 100644 --- a/commands/admin/kick.js +++ b/commands/admin/kick.js @@ -25,7 +25,7 @@ class KickCommand extends Command { ], clientPermissions: ['KICK_MEMBERS', 'SEND_MESSAGES'], userPermissions: ['KICK_MEMBERS'], - channelRestriction: 'guild', + channel: 'guild', description: { content: 'Kick user', usage: '[@user] [reason]', diff --git a/commands/admin/prune.js b/commands/admin/prune.js index 8056ed95..3c361223 100644 --- a/commands/admin/prune.js +++ b/commands/admin/prune.js @@ -16,7 +16,7 @@ class PruneCommand extends Command { ], clientPermissions: ['MANAGE_MESSAGES', 'SEND_MESSAGES'], userPermissions: ['MANAGE_MESSAGES'], - channelRestriction: 'guild', + channel: 'guild', description: { content: 'Bulk delete messages', usage: '[amount]', diff --git a/commands/admin/quotation.js b/commands/admin/quotation.js index 0a35f34e..8aee77bc 100644 --- a/commands/admin/quotation.js +++ b/commands/admin/quotation.js @@ -17,7 +17,7 @@ class quotationCommand extends Command { ], clientPermissions: ['SEND_MESSAGES'], userPermissions: ['MANAGE_MESSAGES'], - channelRestriction: 'guild', + channel: 'guild', description: { content: 'enable/disable quotation', usage: '[enable/disable]', diff --git a/commands/admin/shameboard.js b/commands/admin/shameboard.js index 15d74b6a..814f930b 100644 --- a/commands/admin/shameboard.js +++ b/commands/admin/shameboard.js @@ -6,7 +6,7 @@ class shameboardCommand extends Command { super('shameboard', { aliases: ['shameboard'], category: 'admin', - channelRestriction: 'guild', + channel: 'guild', userPermissions: ['MANAGE_CHANNELS'], args: [ { diff --git a/commands/admin/slowmode.js b/commands/admin/slowmode.js index f8789e2a..78015829 100644 --- a/commands/admin/slowmode.js +++ b/commands/admin/slowmode.js @@ -24,7 +24,7 @@ class SlowmodeCommand extends Command { ], clientPermissions: ['MANAGE_CHANNELS'], userPermissions: ['MANAGE_MESSAGES'], - channelRestriction: 'guild', + channel: 'guild', description: { content: 'Put a channel in slowmode', usage: '[1-120 slowmode] [Number of minutes the slowmode stay active]', diff --git a/commands/admin/starboard.js b/commands/admin/starboard.js index 3d17c895..f0e914cb 100644 --- a/commands/admin/starboard.js +++ b/commands/admin/starboard.js @@ -6,7 +6,7 @@ class StarBoardCommand extends Command { super('starboard', { aliases: ['starboard'], category: 'admin', - channelRestriction: 'guild', + channel: 'guild', userPermissions: ['MANAGE_CHANNELS'], args: [ { diff --git a/commands/admin/tag.js b/commands/admin/tag.js index 145d1381..9366a306 100644 --- a/commands/admin/tag.js +++ b/commands/admin/tag.js @@ -28,7 +28,7 @@ class TagCommand extends Command { match: 'rest', } ], - channelRestriction: 'guild', + channel: 'guild', description: { content: 'Create custom autoresponse (--remove to delete a tag, --reset to delete EVERY tag on the server) [Click here to see the complete list of "tag"](https://cdn.discordapp.com/attachments/502198809355354133/561043193949585418/unknown.png) (Need "" if the trigger contains spaces)', usage: '[trigger] [response]', diff --git a/commands/admin/unban.js b/commands/admin/unban.js index c2eb1a33..3a10447c 100644 --- a/commands/admin/unban.js +++ b/commands/admin/unban.js @@ -17,7 +17,7 @@ class UnbanCommand extends Command { ], clientPermissions: ['BAN_MEMBERS'], userPermissions: ['BAN_MEMBERS'], - channelRestriction: 'guild', + channel: 'guild', description: { content: 'unban users', usage: '[user id]', diff --git a/commands/admin/welcome.js b/commands/admin/welcome.js index 23c8ab4e..167ed81e 100644 --- a/commands/admin/welcome.js +++ b/commands/admin/welcome.js @@ -6,7 +6,7 @@ class welcomeCommand extends Command { super('welcome', { aliases: ['welcome', 'join'], category: 'admin', - channelRestriction: 'guild', + channel: 'guild', userPermissions: ['MANAGE_CHANNELS'], args: [ { diff --git a/commands/admin/whitelistword.js b/commands/admin/whitelistword.js index 441b0637..cacec84d 100644 --- a/commands/admin/whitelistword.js +++ b/commands/admin/whitelistword.js @@ -25,7 +25,7 @@ class whitelistWordCommand extends Command { flag: '--removeall' } ], - channelRestriction: 'guild', + channel: 'guild', description: { content: 'Whitelist word so it is not affected by the banned word, unwhitelistword alias and --removeaall to remove every banned whitelisted word', usage: '[word to whitelist]', diff --git a/commands/owner/addDonator.js b/commands/owner/addDonator.js index e5415829..4dc36785 100644 --- a/commands/owner/addDonator.js +++ b/commands/owner/addDonator.js @@ -22,7 +22,7 @@ class addDonatorCommand extends Command { match: 'rest' } ], - channelRestriction: 'guild', + channel: 'guild', description: { content: 'Add id to the list of people who donated', usage: '[userID] [userComment]', diff --git a/commands/owner/addResponse.js b/commands/owner/addResponse.js index 8cddc99d..32b76f27 100644 --- a/commands/owner/addResponse.js +++ b/commands/owner/addResponse.js @@ -31,7 +31,7 @@ class addResponseCommand extends Command { } } ], - channelRestriction: 'guild', + channel: 'guild', description: { content: 'Create custom autoresponse', usage: '[trigger] [response]', diff --git a/commands/owner/blacklist.js b/commands/owner/blacklist.js index 2f80d602..83713c09 100644 --- a/commands/owner/blacklist.js +++ b/commands/owner/blacklist.js @@ -17,7 +17,7 @@ class blacklistCommand extends Command { } } ], - channelRestriction: 'guild', + channel: 'guild', description: { content: 'Blacklist user from the bot', usage: '[userID]', diff --git a/commands/owner/removeResponse.js b/commands/owner/removeResponse.js index 35c2f519..d080ac57 100644 --- a/commands/owner/removeResponse.js +++ b/commands/owner/removeResponse.js @@ -18,7 +18,7 @@ class removeResponseCommand extends Command { } } ], - channelRestriction: 'guild', + channel: 'guild', description: { content: 'Remove created custom autoresponse', usage: '[trigger]', diff --git a/commands/owner/serverblacklist.js b/commands/owner/serverblacklist.js index a432c738..3673979a 100644 --- a/commands/owner/serverblacklist.js +++ b/commands/owner/serverblacklist.js @@ -17,7 +17,7 @@ class serverBlacklistCommand extends Command { } } ], - channelRestriction: 'guild', + channel: 'guild', description: { content: 'Blacklist guild from the bot', usage: '[GuildID]', diff --git a/commands/owner/twitterBlacklist.js b/commands/owner/twitterBlacklist.js index 0129c523..83295ab3 100644 --- a/commands/owner/twitterBlacklist.js +++ b/commands/owner/twitterBlacklist.js @@ -26,7 +26,7 @@ class TwitterBlacklistCommand extends Command { } } ], - channelRestriction: 'guild', + channel: 'guild', description: { content: 'Blacklist user from the twitter command', usage: '[userID]', diff --git a/commands/reserved/bsespam.js b/commands/reserved/bsespam.js index ace7cc21..01cfc8b3 100644 --- a/commands/reserved/bsespam.js +++ b/commands/reserved/bsespam.js @@ -5,7 +5,7 @@ class bsespamCommand extends Command { super('bsespam', { aliases: ['bsespam'] , //Required category: 'reserved', //recommended - channelRestriction: 'guild', //needed if you want to restrict where we can launch the command + channel: 'guild', //needed if you want to restrict where we can launch the command cooldown: 1800000, ratelimit: 2, args: [ //if need args diff --git a/commands/utility/color.js b/commands/utility/color.js index da9b4381..c1f90513 100644 --- a/commands/utility/color.js +++ b/commands/utility/color.js @@ -6,6 +6,7 @@ class colorCommand extends Command { aliases: ['color', 'colour'], category: 'utility', clientPermissions: ['SEND_MESSAGES', 'MANAGE_ROLES'], + channel: 'guild', args: [ { id: 'color', diff --git a/commands/utility/screenshot.js b/commands/utility/screenshot.js index 41704cd1..6d5a4049 100644 --- a/commands/utility/screenshot.js +++ b/commands/utility/screenshot.js @@ -20,7 +20,7 @@ class screenshotCommand extends Command { flag: '--full' } ], - channelRestriction: 'guild', + channel: 'guild', description: { content: 'Take a screenshot of a website. Need to start with http(s)://. Use --full to take a full page capture', usage: '[link to a website] [optional: --full]', diff --git a/commands/utility/seebannedword.js b/commands/utility/seebannedword.js index 43800106..d17f98c8 100644 --- a/commands/utility/seebannedword.js +++ b/commands/utility/seebannedword.js @@ -8,7 +8,7 @@ class seebannedwordCommand extends Command { aliases: ['seebannedword', 'seeban', 'seebanword'], category: 'utility', clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'], - channelRestriction: 'guild', + channel: 'guild', description: { content: 'Show the list of banned word', usage: '', diff --git a/commands/utility/seetag.js b/commands/utility/seetag.js index da5d2c4a..e50f2e4b 100644 --- a/commands/utility/seetag.js +++ b/commands/utility/seetag.js @@ -9,7 +9,7 @@ class seetagCommand extends Command { aliases: ['seetag', 'taglist', 'tags'], category: 'utility', clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS', 'ATTACH_FILES'], - channelRestriction: 'guild', + channel: 'guild', args: [ { id: 'raw', diff --git a/commands/utility/server.js b/commands/utility/server.js index c88af2c2..df82a245 100644 --- a/commands/utility/server.js +++ b/commands/utility/server.js @@ -6,7 +6,7 @@ class ServerCommand extends Command { aliases: ['server', 'serverinfo'], category: 'utility', clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'], - channelRestriction: 'guild', + channel: 'guild', description: { content: 'Show info about the server', usage: '', diff --git a/commands/utility/serverIcon.js b/commands/utility/serverIcon.js index 7332601f..8ec08788 100644 --- a/commands/utility/serverIcon.js +++ b/commands/utility/serverIcon.js @@ -6,6 +6,7 @@ class serverIconCommand extends Command { aliases: ['serverIcon'], category: 'utility', clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], + channel: 'guild', args: [ { id: 'serverid', diff --git a/commands/utility/updoot.js b/commands/utility/updoot.js index 276771eb..402990fa 100644 --- a/commands/utility/updoot.js +++ b/commands/utility/updoot.js @@ -5,7 +5,7 @@ class UpdootCommand extends Command { super('updoot', { aliases: ['updoot', 'upvote', 'vote'], category: 'utility', - channelRestriction: 'guild', + channel: 'guild', clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'], description: { content: 'Send a link to vote for my bot', diff --git a/commands/utility/userInfo.js b/commands/utility/userInfo.js index 5c49cbe8..69fc7576 100644 --- a/commands/utility/userInfo.js +++ b/commands/utility/userInfo.js @@ -6,7 +6,7 @@ class userInfoCommand extends Command { aliases: ['userInfo', 'user'], category: 'utility', clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'], - channelRestriction: 'guild', + channel: 'guild', args: [ { id: 'user', diff --git a/event/listeners/commandblocked.js b/event/listeners/commandblocked.js index 5da00fef..1118063e 100644 --- a/event/listeners/commandblocked.js +++ b/event/listeners/commandblocked.js @@ -25,10 +25,10 @@ class CommandBlockedListener extends Listener { message.reply(Embed); break; case 'guild': - message.reply('You can\'t use this command in a guild!'); + message.reply('You can\'t use this command in DM!'); break; case 'dm': - message.reply('You can\'t use this command in DM!'); + message.reply('You can\'t use this command in a guild!'); break; case 'blacklist': blacklistMessage = ['bro... i think you are blacklisted.... OWNED!!!', 'You can\'t use this command because you have been blacklisted!',' you are blacklisted!!!1111!! be less naughty next time!', 'blacklisted,,,,,, lol owned bro'];