fix channel restriction

This commit is contained in:
loicbersier 2020-03-19 23:24:31 +01:00
parent 097d878ca5
commit 3b2e306977
33 changed files with 34 additions and 32 deletions

View file

@ -17,7 +17,7 @@ class autoresponseCommand extends Command {
], ],
clientPermissions: ['SEND_MESSAGES'], clientPermissions: ['SEND_MESSAGES'],
userPermissions: ['MANAGE_MESSAGES'], userPermissions: ['MANAGE_MESSAGES'],
channelRestriction: 'guild', channel: 'guild',
description: { description: {
content: 'enable/disable autoresponse', content: 'enable/disable autoresponse',
usage: '[enable/disable]', usage: '[enable/disable]',

View file

@ -26,7 +26,7 @@ class BanCommand extends Command {
], ],
clientPermissions: ['BAN_MEMBERS', 'SEND_MESSAGES'], clientPermissions: ['BAN_MEMBERS', 'SEND_MESSAGES'],
userPermissions: ['BAN_MEMBERS'], userPermissions: ['BAN_MEMBERS'],
channelRestriction: 'guild', channel: 'guild',
description: { description: {
content: 'Ban user | For hackban precise the userid', content: 'Ban user | For hackban precise the userid',
usage: '[@user] [reason] OR [userID] [reason]', usage: '[@user] [reason] OR [userID] [reason]',

View file

@ -25,7 +25,7 @@ class BannedWordsCommand extends Command {
flag: '--removeall' flag: '--removeall'
} }
], ],
channelRestriction: 'guild', channel: 'guild',
description: { 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', 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]', usage: '[word to ban]',

View file

@ -6,7 +6,7 @@ class byeCommand extends Command {
super('bye', { super('bye', {
aliases: ['bye', 'leave'], aliases: ['bye', 'leave'],
category: 'admin', category: 'admin',
channelRestriction: 'guild', channel: 'guild',
userPermissions: ['MANAGE_CHANNELS'], userPermissions: ['MANAGE_CHANNELS'],
clientPermissions: ['SEND_MESSAGES'], clientPermissions: ['SEND_MESSAGES'],
args: [ args: [

View file

@ -18,7 +18,7 @@ class commandblockCommand extends Command {
], ],
clientPermissions: ['SEND_MESSAGES'], clientPermissions: ['SEND_MESSAGES'],
userPermissions: ['ADMINISTRATOR'], userPermissions: ['ADMINISTRATOR'],
channelRestriction: 'guild', channel: 'guild',
description: { description: {
content: 'Block a command. Execute that command again to unblock a command', content: 'Block a command. Execute that command again to unblock a command',
usage: '[command name]', usage: '[command name]',

View file

@ -6,7 +6,7 @@ class fakejoinCommand extends Command {
super('fakejoin', { super('fakejoin', {
aliases: ['fakejoin'], aliases: ['fakejoin'],
category: 'admin', category: 'admin',
channelRestriction: 'guild', channel: 'guild',
clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'],
args: [ args: [
{ {

View file

@ -6,7 +6,7 @@ class fakeleaveCommand extends Command {
super('fakeleave', { super('fakeleave', {
aliases: ['fakeleave'], aliases: ['fakeleave'],
category: 'admin', category: 'admin',
channelRestriction: 'guild', channel: 'guild',
clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'],
args: [ args: [
{ {

View file

@ -25,7 +25,7 @@ class KickCommand extends Command {
], ],
clientPermissions: ['KICK_MEMBERS', 'SEND_MESSAGES'], clientPermissions: ['KICK_MEMBERS', 'SEND_MESSAGES'],
userPermissions: ['KICK_MEMBERS'], userPermissions: ['KICK_MEMBERS'],
channelRestriction: 'guild', channel: 'guild',
description: { description: {
content: 'Kick user', content: 'Kick user',
usage: '[@user] [reason]', usage: '[@user] [reason]',

View file

@ -16,7 +16,7 @@ class PruneCommand extends Command {
], ],
clientPermissions: ['MANAGE_MESSAGES', 'SEND_MESSAGES'], clientPermissions: ['MANAGE_MESSAGES', 'SEND_MESSAGES'],
userPermissions: ['MANAGE_MESSAGES'], userPermissions: ['MANAGE_MESSAGES'],
channelRestriction: 'guild', channel: 'guild',
description: { description: {
content: 'Bulk delete messages', content: 'Bulk delete messages',
usage: '[amount]', usage: '[amount]',

View file

@ -17,7 +17,7 @@ class quotationCommand extends Command {
], ],
clientPermissions: ['SEND_MESSAGES'], clientPermissions: ['SEND_MESSAGES'],
userPermissions: ['MANAGE_MESSAGES'], userPermissions: ['MANAGE_MESSAGES'],
channelRestriction: 'guild', channel: 'guild',
description: { description: {
content: 'enable/disable quotation', content: 'enable/disable quotation',
usage: '[enable/disable]', usage: '[enable/disable]',

View file

@ -6,7 +6,7 @@ class shameboardCommand extends Command {
super('shameboard', { super('shameboard', {
aliases: ['shameboard'], aliases: ['shameboard'],
category: 'admin', category: 'admin',
channelRestriction: 'guild', channel: 'guild',
userPermissions: ['MANAGE_CHANNELS'], userPermissions: ['MANAGE_CHANNELS'],
args: [ args: [
{ {

View file

@ -24,7 +24,7 @@ class SlowmodeCommand extends Command {
], ],
clientPermissions: ['MANAGE_CHANNELS'], clientPermissions: ['MANAGE_CHANNELS'],
userPermissions: ['MANAGE_MESSAGES'], userPermissions: ['MANAGE_MESSAGES'],
channelRestriction: 'guild', channel: 'guild',
description: { description: {
content: 'Put a channel in slowmode', content: 'Put a channel in slowmode',
usage: '[1-120 slowmode] [Number of minutes the slowmode stay active]', usage: '[1-120 slowmode] [Number of minutes the slowmode stay active]',

View file

@ -6,7 +6,7 @@ class StarBoardCommand extends Command {
super('starboard', { super('starboard', {
aliases: ['starboard'], aliases: ['starboard'],
category: 'admin', category: 'admin',
channelRestriction: 'guild', channel: 'guild',
userPermissions: ['MANAGE_CHANNELS'], userPermissions: ['MANAGE_CHANNELS'],
args: [ args: [
{ {

View file

@ -28,7 +28,7 @@ class TagCommand extends Command {
match: 'rest', match: 'rest',
} }
], ],
channelRestriction: 'guild', channel: 'guild',
description: { 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)', 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]', usage: '[trigger] [response]',

View file

@ -17,7 +17,7 @@ class UnbanCommand extends Command {
], ],
clientPermissions: ['BAN_MEMBERS'], clientPermissions: ['BAN_MEMBERS'],
userPermissions: ['BAN_MEMBERS'], userPermissions: ['BAN_MEMBERS'],
channelRestriction: 'guild', channel: 'guild',
description: { description: {
content: 'unban users', content: 'unban users',
usage: '[user id]', usage: '[user id]',

View file

@ -6,7 +6,7 @@ class welcomeCommand extends Command {
super('welcome', { super('welcome', {
aliases: ['welcome', 'join'], aliases: ['welcome', 'join'],
category: 'admin', category: 'admin',
channelRestriction: 'guild', channel: 'guild',
userPermissions: ['MANAGE_CHANNELS'], userPermissions: ['MANAGE_CHANNELS'],
args: [ args: [
{ {

View file

@ -25,7 +25,7 @@ class whitelistWordCommand extends Command {
flag: '--removeall' flag: '--removeall'
} }
], ],
channelRestriction: 'guild', channel: 'guild',
description: { description: {
content: 'Whitelist word so it is not affected by the banned word, unwhitelistword alias and --removeaall to remove every banned whitelisted word', 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]', usage: '[word to whitelist]',

View file

@ -22,7 +22,7 @@ class addDonatorCommand extends Command {
match: 'rest' match: 'rest'
} }
], ],
channelRestriction: 'guild', channel: 'guild',
description: { description: {
content: 'Add id to the list of people who donated', content: 'Add id to the list of people who donated',
usage: '[userID] [userComment]', usage: '[userID] [userComment]',

View file

@ -31,7 +31,7 @@ class addResponseCommand extends Command {
} }
} }
], ],
channelRestriction: 'guild', channel: 'guild',
description: { description: {
content: 'Create custom autoresponse', content: 'Create custom autoresponse',
usage: '[trigger] [response]', usage: '[trigger] [response]',

View file

@ -17,7 +17,7 @@ class blacklistCommand extends Command {
} }
} }
], ],
channelRestriction: 'guild', channel: 'guild',
description: { description: {
content: 'Blacklist user from the bot', content: 'Blacklist user from the bot',
usage: '[userID]', usage: '[userID]',

View file

@ -18,7 +18,7 @@ class removeResponseCommand extends Command {
} }
} }
], ],
channelRestriction: 'guild', channel: 'guild',
description: { description: {
content: 'Remove created custom autoresponse', content: 'Remove created custom autoresponse',
usage: '[trigger]', usage: '[trigger]',

View file

@ -17,7 +17,7 @@ class serverBlacklistCommand extends Command {
} }
} }
], ],
channelRestriction: 'guild', channel: 'guild',
description: { description: {
content: 'Blacklist guild from the bot', content: 'Blacklist guild from the bot',
usage: '[GuildID]', usage: '[GuildID]',

View file

@ -26,7 +26,7 @@ class TwitterBlacklistCommand extends Command {
} }
} }
], ],
channelRestriction: 'guild', channel: 'guild',
description: { description: {
content: 'Blacklist user from the twitter command', content: 'Blacklist user from the twitter command',
usage: '[userID]', usage: '[userID]',

View file

@ -5,7 +5,7 @@ class bsespamCommand extends Command {
super('bsespam', { super('bsespam', {
aliases: ['bsespam'] , //Required aliases: ['bsespam'] , //Required
category: 'reserved', //recommended 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, cooldown: 1800000,
ratelimit: 2, ratelimit: 2,
args: [ //if need args args: [ //if need args

View file

@ -6,6 +6,7 @@ class colorCommand extends Command {
aliases: ['color', 'colour'], aliases: ['color', 'colour'],
category: 'utility', category: 'utility',
clientPermissions: ['SEND_MESSAGES', 'MANAGE_ROLES'], clientPermissions: ['SEND_MESSAGES', 'MANAGE_ROLES'],
channel: 'guild',
args: [ args: [
{ {
id: 'color', id: 'color',

View file

@ -20,7 +20,7 @@ class screenshotCommand extends Command {
flag: '--full' flag: '--full'
} }
], ],
channelRestriction: 'guild', channel: 'guild',
description: { description: {
content: 'Take a screenshot of a website. Need to start with http(s)://. Use --full to take a full page capture', 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]', usage: '[link to a website] [optional: --full]',

View file

@ -8,7 +8,7 @@ class seebannedwordCommand extends Command {
aliases: ['seebannedword', 'seeban', 'seebanword'], aliases: ['seebannedword', 'seeban', 'seebanword'],
category: 'utility', category: 'utility',
clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'], clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'],
channelRestriction: 'guild', channel: 'guild',
description: { description: {
content: 'Show the list of banned word', content: 'Show the list of banned word',
usage: '', usage: '',

View file

@ -9,7 +9,7 @@ class seetagCommand extends Command {
aliases: ['seetag', 'taglist', 'tags'], aliases: ['seetag', 'taglist', 'tags'],
category: 'utility', category: 'utility',
clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS', 'ATTACH_FILES'], clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS', 'ATTACH_FILES'],
channelRestriction: 'guild', channel: 'guild',
args: [ args: [
{ {
id: 'raw', id: 'raw',

View file

@ -6,7 +6,7 @@ class ServerCommand extends Command {
aliases: ['server', 'serverinfo'], aliases: ['server', 'serverinfo'],
category: 'utility', category: 'utility',
clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'], clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'],
channelRestriction: 'guild', channel: 'guild',
description: { description: {
content: 'Show info about the server', content: 'Show info about the server',
usage: '', usage: '',

View file

@ -6,6 +6,7 @@ class serverIconCommand extends Command {
aliases: ['serverIcon'], aliases: ['serverIcon'],
category: 'utility', category: 'utility',
clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'],
channel: 'guild',
args: [ args: [
{ {
id: 'serverid', id: 'serverid',

View file

@ -5,7 +5,7 @@ class UpdootCommand extends Command {
super('updoot', { super('updoot', {
aliases: ['updoot', 'upvote', 'vote'], aliases: ['updoot', 'upvote', 'vote'],
category: 'utility', category: 'utility',
channelRestriction: 'guild', channel: 'guild',
clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'], clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'],
description: { description: {
content: 'Send a link to vote for my bot', content: 'Send a link to vote for my bot',

View file

@ -6,7 +6,7 @@ class userInfoCommand extends Command {
aliases: ['userInfo', 'user'], aliases: ['userInfo', 'user'],
category: 'utility', category: 'utility',
clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'], clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'],
channelRestriction: 'guild', channel: 'guild',
args: [ args: [
{ {
id: 'user', id: 'user',

View file

@ -25,10 +25,10 @@ class CommandBlockedListener extends Listener {
message.reply(Embed); message.reply(Embed);
break; break;
case 'guild': case 'guild':
message.reply('You can\'t use this command in a guild!'); message.reply('You can\'t use this command in DM!');
break; break;
case 'dm': case 'dm':
message.reply('You can\'t use this command in DM!'); message.reply('You can\'t use this command in a guild!');
break; break;
case 'blacklist': 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']; 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'];