mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 14:19:11 +02:00
Framework Rewrite
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { util: { permissions } } = require('discord.js-commando');
|
||||
const permissions = require('../../assets/json/permission-names');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
module.exports = class HelpCommand extends Command {
|
||||
@@ -31,7 +31,7 @@ module.exports = class HelpCommand extends Command {
|
||||
const embed = new MessageEmbed()
|
||||
.setTitle(`Command List (Page ${i + 1})`)
|
||||
.setDescription(stripIndents`
|
||||
To run a command, use ${msg.anyUsage('<command>')}.
|
||||
To run a command, use ${this.usage()}.
|
||||
${nsfw ? '' : 'Use in an NSFW channel to see NSFW commands.'}
|
||||
`)
|
||||
.setColor(0x00AE86);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed, version: djsVersion } = require('discord.js');
|
||||
const { version: commandoVersion } = require('discord.js-commando');
|
||||
const moment = require('moment');
|
||||
require('moment-duration-format');
|
||||
const { formatNumber, embedURL } = require('../../util/Util');
|
||||
@@ -39,7 +38,7 @@ module.exports = class InfoCommand extends Command {
|
||||
.addField('❯ Version', `v${version}`, true)
|
||||
.addField('❯ Node.js', process.version, true)
|
||||
.addField('❯ Discord.js', `v${djsVersion}`, true)
|
||||
.addField('❯ Commando', `v${commandoVersion}`, true)
|
||||
.addField('❯ Framework', 'Custom', true)
|
||||
.addField('❯ Dependencies', Object.keys(deps).sort().join(', '));
|
||||
return msg.embed(embed);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
module.exports = class PrefixCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -14,9 +13,6 @@ module.exports = class PrefixCommand extends Command {
|
||||
|
||||
run(msg) {
|
||||
const prefix = msg.guild ? msg.guild.commandPrefix : this.client.commandPrefix;
|
||||
return msg.reply(stripIndents`
|
||||
${prefix ? `The command prefix is \`${prefix}\`.` : 'There is no command prefix.'}
|
||||
To run a command, use ${msg.anyUsage('<command>')}.
|
||||
`);
|
||||
return msg.reply(prefix ? `The command prefix is \`${prefix}\`.` : 'There is no command prefix.');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -18,7 +18,7 @@ module.exports = class UnknownCommandCommand extends Command {
|
||||
run(msg) {
|
||||
if (!msg.guild) return null;
|
||||
const commands = this.makeCommandArray(this.client.isOwner(msg.author), msg.channel.nsfw);
|
||||
const command = msg.content.match(this.client.dispatcher._commandPatterns[this.client.commandPrefix]);
|
||||
const command = msg.content.match(this.client.dispatcher.commandPattern);
|
||||
const str = command ? command[2] : msg.content.split(' ')[0];
|
||||
const results = didYouMean(str, commands, { returnType: ReturnTypeEnums.ALL_SORTED_MATCHES });
|
||||
return msg.reply(stripIndents`
|
||||
|
||||
Reference in New Issue
Block a user