mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-13 08:19:08 +02:00
Remove home server stuff
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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')}
|
||||
`);
|
||||
}
|
||||
};
|
||||
@@ -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}**!`);
|
||||
}
|
||||
};
|
||||
@@ -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
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "62.5.1",
|
||||
"version": "63.0.0",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user