Remove home server stuff

This commit is contained in:
Daniel Odendahl Jr
2018-02-12 23:26:58 +00:00
parent 7beaff5b2b
commit 4a18810d3a
5 changed files with 2 additions and 97 deletions
+1 -2
View File
@@ -29,8 +29,7 @@ client.registry
['text-edit', 'Text Manipulation'],
['number-edit', 'Number Manipulation'],
['other', 'Other'],
['roleplay', 'Roleplay'],
['role-manage', 'Home Server Role Management']
['roleplay', 'Roleplay']
])
.registerDefaultCommands({
help: false,
-26
View File
@@ -1,26 +0,0 @@
const { Command } = require('discord.js-commando');
const { stripIndents } = require('common-tags');
const { HOME_GUILD_ID, HOME_GUILD_ROLES } = process.env;
const roles = HOME_GUILD_ROLES.split(',');
module.exports = class RoleListCommand extends Command {
constructor(client) {
super(client, {
name: 'role-list',
aliases: ['roles'],
group: 'role-manage',
memberName: 'role-list',
description: 'Responds with all available roles to join in the home server.',
details: 'This command only works in the home server.',
guildOnly: true
});
}
run(msg) {
if (msg.guild.id !== HOME_GUILD_ID) return msg.reply('This command only works in the home server.');
return msg.say(stripIndents`
**Roles available in ${msg.guild.name}**:
${msg.guild.roles.filter(role => roles.includes(role.id)).map(role => role.name).join('\n')}
`);
}
};
-34
View File
@@ -1,34 +0,0 @@
const { Command } = require('discord.js-commando');
const { HOME_GUILD_ID, HOME_GUILD_ROLES } = process.env;
const roles = HOME_GUILD_ROLES.split(',');
module.exports = class SubscribeCommand extends Command {
constructor(client) {
super(client, {
name: 'subscribe',
aliases: ['join'],
group: 'role-manage',
memberName: 'subscribe',
description: 'Subscribes you to the specified role.',
details: 'This command only works in the home server.',
guildOnly: true,
clientPermissions: ['MANAGE_ROLES'],
args: [
{
key: 'role',
prompt: 'What role do you want to subscribe to?',
type: 'role'
}
]
});
}
async run(msg, { role }) {
if (msg.guild.id !== HOME_GUILD_ID) return msg.reply('This command only works in the home server.');
if (!roles.includes(role.id)) return msg.reply('This role is not open!');
if (!role.editable) return msg.reply('I do not have permission to manage this role!');
if (msg.member.roles.has(role.id)) return msg.reply('You are already a member of this role!');
await msg.member.roles.add(role);
return msg.say(`You were added to **${role.name}**!`);
}
};
-34
View File
@@ -1,34 +0,0 @@
const { Command } = require('discord.js-commando');
const { HOME_GUILD_ID, HOME_GUILD_ROLES } = process.env;
const roles = HOME_GUILD_ROLES.split(',');
module.exports = class UnsubscribeCommand extends Command {
constructor(client) {
super(client, {
name: 'unsubscribe',
aliases: ['leave'],
group: 'role-manage',
memberName: 'unsubscribe',
description: 'Unsubscribes you from the specified role.',
details: 'This command only works in the home server.',
guildOnly: true,
clientPermissions: ['MANAGE_ROLES'],
args: [
{
key: 'role',
prompt: 'What role do you want to unsubscribe from?',
type: 'role'
}
]
});
}
async run(msg, { role }) {
if (msg.guild.id !== HOME_GUILD_ID) return msg.reply('This command only works in the home server.');
if (!roles.includes(role.id)) return msg.reply('This role is not open!');
if (!role.editable) return msg.reply('I do not have permission to manage this role!');
if (!msg.member.roles.has(role.id)) return msg.reply('You are not a member of this role!');
await msg.member.roles.remove(role);
return msg.say(`You were removed from **${role.name}**...`);
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "62.5.1",
"version": "63.0.0",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {