Change where invite guard is located

This commit is contained in:
Daniel Odendahl Jr
2017-05-20 14:18:21 +00:00
parent b3a351fdc4
commit 97365f68a1
5 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -6,16 +6,16 @@ module.exports = class ClearSettingCommand extends Command {
name: 'clear-setting',
group: 'settings',
memberName: 'clear-setting',
description: 'Removes a custom-set Guard Mode, Mod Channel, Member Channel, Member Message, Staff Role, or Single Role.',
description: 'Removes a custom setting from your server.',
guildOnly: true,
args: [
{
key: 'setting',
prompt: 'What setting do you want to clear? `guard`, `modLog`, `memberLog`, `joinMsg`, `leaveMsg`, `staffRole`, or `singleRole`?',
prompt: 'What setting do you want to clear? `inviteGuard`, `modLog`, `memberLog`, `joinMsg`, `leaveMsg`, `staffRole`, or `singleRole`?',
type: 'string',
validate: setting => {
if (['guard', 'modLog', 'memberLog', 'joinMsg', 'leaveMsg', 'staffRole', 'singleRole'].includes(setting)) return true;
return 'Please enter either `guard`, `modLog`, `memberLog`, `joinMsg`, `leaveMsg`, `staffRole`, or `singleRole`.';
if (['inviteGuard', 'modLog', 'memberLog', 'joinMsg', 'leaveMsg', 'staffRole', 'singleRole'].includes(setting)) return true;
return 'Please enter either `inviteGuard`, `modLog`, `memberLog`, `joinMsg`, `leaveMsg`, `staffRole`, or `singleRole`.';
}
}
]
+1 -1
View File
@@ -16,7 +16,7 @@ module.exports = class InviteGuardCommand extends Command {
}
run(msg) {
msg.guild.settings.set('guard', true);
msg.guild.settings.set('inviteGuard', true);
return msg.say('Invite Guard is now active.');
}
};
+1 -1
View File
@@ -19,7 +19,7 @@ module.exports = class SettingListCommand extends Command {
const singleRole = msg.guild.settings.get('singleRole', false);
return msg.say(stripIndents`
**Prefix:** ${msg.guild.commandPrefix}
**Invite Guard:** ${msg.guild.settings.get('guard', false)}
**Invite Guard:** ${msg.guild.settings.get('inviteGuard', false)}
**Staff Role:** ${staffRole ? (msg.guild.roles.has(staffRole) ? msg.guild.roles.get(staffRole).name : 'Missing') : 'None'}
**Mod Channel:** ${modLog ? (msg.guild.channels.has(modLog) ? msg.guild.channels.get(modLog).name : 'Missing') : 'None'}
**Member Channel:** ${memberLog ? (msg.guild.channels.has(memberLog) ? msg.guild.channels.get(memberLog).name : 'Missing') : 'None'}
+1 -1
View File
@@ -66,7 +66,7 @@ client.on('commandError', (command, err) => {
});
client.on('message', async (msg) => {
if (msg.guild && msg.guild.settings.get('guard') && /(discord(.gg\/|app.com\/invite\/))/g.test(msg.content)) {
if (msg.guild && msg.guild.settings.get('inviteGuard') && /(discord(.gg\/|app.com\/invite\/))/g.test(msg.content)) {
if (msg.author.bot
|| msg.member.hasPermission('ADMINISTRATOR')
|| msg.author.id === msg.guild.ownerID
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiaobot",
"version": "19.10.0",
"version": "19.10.1",
"description": "A Discord Bot",
"main": "shardingmanager.js",
"scripts": {