mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-11 15:57:50 +02:00
Beep
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { util } = require('discord.js-commando');
|
||||
const { util: { permissions } } = require('discord.js-commando');
|
||||
|
||||
module.exports = class RoleInfoCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -24,7 +24,7 @@ module.exports = class RoleInfoCommand extends Command {
|
||||
|
||||
run(msg, { role }) {
|
||||
const serialized = role.permissions.serialize();
|
||||
const perms = Object.keys(util.permissions).filter(perm => serialized[perm]);
|
||||
const perms = Object.keys(permissions).filter(perm => serialized[perm]);
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(role.hexColor)
|
||||
.addField('❯ Name',
|
||||
@@ -40,7 +40,7 @@ module.exports = class RoleInfoCommand extends Command {
|
||||
.addField('❯ Mentionable',
|
||||
role.mentionable ? 'Yes' : 'No', true)
|
||||
.addField('❯ Permissions',
|
||||
perms.map(perm => util.permissions[perm]).join(', ') || 'None');
|
||||
perms.map(perm => permissions[perm]).join(', ') || 'None');
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const { util: { disambiguation } } = require('discord.js-commando');
|
||||
|
||||
module.exports = class HelpCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -34,11 +35,9 @@ module.exports = class HelpCommand extends Command {
|
||||
**Format**: ${msg.anyUsage(`${data.name} ${data.format || ''}`)}
|
||||
**Aliases**: ${data.aliases.join(', ') || 'None'}
|
||||
**Group**: ${data.group.name} (\`${data.groupID}:${data.memberName}\`)
|
||||
**Examples**:
|
||||
${data.examples ? data.examples.join('\n') : 'None'}
|
||||
`);
|
||||
} else if (commands.length > 1) {
|
||||
return msg.say(`Multiple commands found: ${commands.map(cmd => cmd.name).join(', ')}`);
|
||||
return msg.say(disambiguation(commands, 'commands'));
|
||||
}
|
||||
return msg.say(`Could not identify command. Use ${msg.usage(null)} to view a list of commands.`);
|
||||
} else {
|
||||
@@ -50,8 +49,10 @@ module.exports = class HelpCommand extends Command {
|
||||
embed.addField(`❯ ${group.name}`, group.commands.map(cmd => cmd.name).join(', ') || 'None');
|
||||
}
|
||||
try {
|
||||
await msg.direct({ embed });
|
||||
return msg.say('📬 Sent you a DM with information.');
|
||||
const msgs = [];
|
||||
msgs.push(await msg.direct({ embed }));
|
||||
if (msg.channel.type !== 'dm') msgs.push(await msg.say('📬 Sent you a DM with information.'));
|
||||
return msgs;
|
||||
} catch (err) {
|
||||
return msg.reply('Failed to send DM. You probably have DMs disabled.');
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiaobot",
|
||||
"version": "55.1.1",
|
||||
"version": "55.1.2",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "XiaoBot.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user