Add commands

This commit is contained in:
Isaac 2021-05-16 15:11:24 +01:00
parent 88bc1c84ac
commit 2ca83c3146
No known key found for this signature in database
GPG Key ID: F6812DBC6719B4E3
8 changed files with 227 additions and 4 deletions

34
src/commands/add.js Normal file
View File

@ -0,0 +1,34 @@
const Command = require('../modules/commands/command');
const { MessageEmbed } = require('discord.js');
module.exports = class AddCommand extends Command {
constructor(client) {
const i18n = client.i18n.getLocale(client.config.locale);
super(client, {
internal: true,
name: i18n('commands.add.name'),
description: i18n('commands.add.description'),
aliases: [],
process_args: false,
args: [
{
name: i18n('commands.add.args.member.name'),
description: i18n('commands.add.args.member.description'),
example: i18n('commands.add.args.member.example'),
required: true,
},
{
name: i18n('commands.add.args.ticket.name'),
description: i18n('commands.add.args.ticket.description'),
example: i18n('commands.add.args.ticket.example'),
required: false,
}
]
});
}
async execute(message, args) {
let settings = await message.guild.settings;
const i18n = this.client.i18n.getLocale(settings.locale);
}
};

View File

@ -11,7 +11,6 @@ module.exports = class BlacklistCommand extends Command {
aliases: [
i18n('commands.blacklist.aliases.unblacklist'),
],
permissions: ['MANAGE_GUILD'], // staff_only: true,
process_args: false,
args: [
{
@ -20,7 +19,8 @@ module.exports = class BlacklistCommand extends Command {
example: i18n('commands.blacklist.args.member_or_role.example'),
required: false,
}
]
],
permissions: ['MANAGE_GUILD']
});
}

31
src/commands/help.js Normal file
View File

@ -0,0 +1,31 @@
const Command = require('../modules/commands/command');
const { MessageEmbed } = require('discord.js');
module.exports = class HelpCommand extends Command {
constructor(client) {
const i18n = client.i18n.getLocale(client.config.locale);
super(client, {
internal: true,
name: i18n('commands.help.name'),
description: i18n('commands.help.description'),
aliases: [
i18n('commands.help.aliases.command'),
i18n('commands.help.aliases.commands'),
],
process_args: false,
args: [
{
name: i18n('commands.help.args.command.name'),
description: i18n('commands.help.args.command.description'),
example: i18n('commands.help.args.command.example'),
required: false,
}
]
});
}
async execute(message, args) {
let settings = await message.guild.settings;
const i18n = this.client.i18n.getLocale(settings.locale);
}
};

34
src/commands/remove.js Normal file
View File

@ -0,0 +1,34 @@
const Command = require('../modules/commands/command');
const { MessageEmbed } = require('discord.js');
module.exports = class RemoveCommand extends Command {
constructor(client) {
const i18n = client.i18n.getLocale(client.config.locale);
super(client, {
internal: true,
name: i18n('commands.remove.name'),
description: i18n('commands.remove.description'),
aliases: [],
process_args: false,
args: [
{
name: i18n('commands.remove.args.member.name'),
description: i18n('commands.remove.args.member.description'),
example: i18n('commands.remove.args.member.example'),
required: true,
},
{
name: i18n('commands.remove.args.ticket.name'),
description: i18n('commands.remove.args.ticket.description'),
example: i18n('commands.remove.args.ticket.example'),
required: false,
}
]
});
}
async execute(message, args) {
let settings = await message.guild.settings;
const i18n = this.client.i18n.getLocale(settings.locale);
}
};

View File

@ -8,10 +8,12 @@ module.exports = class SettingsCommand extends Command {
super(client, {
internal: true,
name: i18n('commands.settings.name'),
description: i18n('commands.settings.description'),
aliases: [
i18n('commands.settings.aliases.config'),
],
description: i18n('commands.settings.description'),
process_args: false,
args: [],
permissions: ['MANAGE_GUILD']
});
}

22
src/commands/stats.js Normal file
View File

@ -0,0 +1,22 @@
const Command = require('../modules/commands/command');
const { MessageEmbed } = require('discord.js');
module.exports = class StatsCommand extends Command {
constructor(client) {
const i18n = client.i18n.getLocale(client.config.locale);
super(client, {
internal: true,
name: i18n('commands.stats.name'),
description: i18n('commands.stats.description'),
aliases: [],
process_args: false,
args: [],
staff_only: true
});
}
async execute(message, args) {
let settings = await message.guild.settings;
const i18n = this.client.i18n.getLocale(settings.locale);
}
};

28
src/commands/topic.js Normal file
View File

@ -0,0 +1,28 @@
const Command = require('../modules/commands/command');
const { MessageEmbed } = require('discord.js');
module.exports = class TopicCommand extends Command {
constructor(client) {
const i18n = client.i18n.getLocale(client.config.locale);
super(client, {
internal: true,
name: i18n('commands.topic.name'),
description: i18n('commands.topic.description'),
aliases: [],
process_args: false,
args: [
{
name: i18n('commands.topic.args.new_topic.name'),
description: i18n('commands.topic.args.new_topic.description'),
example: i18n('commands.topic.args.new_topic.example'),
required: true,
}
]
});
}
async execute(message, args) {
let settings = await message.guild.settings;
const i18n = this.client.i18n.getLocale(settings.locale);
}
};

View File

@ -21,13 +21,31 @@
},
"collector_expires_in": "Expires in %d seconds",
"commands": {
"add": {
"aliases": {},
"args": {
"member": {
"description": "The member to add to the ticket",
"example": "@someone",
"name": "member"
},
"ticket": {
"description": "The ticket to add the member to",
"example": "217",
"name": "ticket"
}
},
"description": "Add a member to a ticket",
"name": "add",
"response": {}
},
"blacklist": {
"aliases": {
"unblacklist": "unblacklist"
},
"args": {
"member_or_role": {
"description": "A member mention, a role mention, or the ID of a member or role",
"description": "The member or role to add/remove",
"example": "@NaughtyMember",
"name": "memberOrRole"
}
@ -140,6 +158,22 @@
}
}
},
"help": {
"aliases": {
"command": "command",
"commands": "commands"
},
"args": {
"member": {
"description": "The command to display information about",
"example": "new",
"name": "command"
}
},
"description": "List commands you have access to, or find out more about a command",
"name": "help",
"response": {}
},
"new": {
"aliases": {
"create": "create",
@ -236,6 +270,24 @@
}
}
},
"remove": {
"aliases": {},
"args": {
"member": {
"description": "The member to remove from the ticket",
"example": "@someone",
"name": "member"
},
"ticket": {
"description": "The ticket to remove the member from",
"example": "217",
"name": "ticket"
}
},
"description": "Remove a member from a ticket",
"name": "remove",
"response": {}
},
"settings": {
"aliases": {
"config": "config"
@ -245,6 +297,26 @@
"response": {
"updated": "✅ Settings have been updated."
}
},
"stats": {
"aliases": {},
"args": {},
"description": "Display ticket statistics",
"name": "stats",
"response": {}
},
"topic": {
"aliases": {},
"args": {
"new_topic": {
"description": "The new topic of the ticket",
"example": "billing issue",
"name": "new_topic"
}
},
"description": "Change the topic of the ticket",
"name": "topic",
"response": {}
}
},
"command_execution_error": {