From b73afedf67daebe618dda75dc061fdf4ac6f5bea Mon Sep 17 00:00:00 2001 From: AnimaFPS Date: Thu, 7 Jan 2021 18:05:49 +1300 Subject: [PATCH] feat(help): new help command using embeds new help command using embeds as well as a slight overhaul of the array system for aliases --- README.md | 57 ++++----- index.js | 6 +- src/array.js | 103 ++++++++++++----- src/commands/math/cm.js | 5 +- src/commands/math/convert.js | 5 +- src/commands/math/deg.js | 5 +- src/commands/math/fov.js | 5 +- src/commands/math/inch.js | 45 ++++++++ src/commands/math/sens.js | 17 +-- src/commands/util/games.js | 7 +- src/commands/util/getobject.js | 7 +- src/commands/util/help.js | 205 +++++++++++++++++++++++++++++++++ 12 files changed, 389 insertions(+), 78 deletions(-) create mode 100644 src/commands/math/inch.js create mode 100644 src/commands/util/help.js diff --git a/README.md b/README.md index 4a5a7f2..64d86c8 100644 --- a/README.md +++ b/README.md @@ -18,45 +18,46 @@ Note: When building or runing from source you have to input your own discord tok ## Usage -<required|alternitive option> -[optional] +\ \[optional\] **exact argument** ### Main Commands -| Command | Arguments | Description | Example | -| -------- | -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | ------------------------- | -| /cm | <sens> <game|yaw> <cpi> | Converts Senstivity to cm/360 | `/cm 6 ow 1600` | -| /deg | <sens> <game|yaw> <cpi> | Converts Senstivity to deg/mm | `/deg 1.9 0.022 800` | -| /convert | <sens> <initial game|yaw> <output game|yaw> | Converts Different Sensitivities from one game to another | `/convert 3 ow 0.022` | -| /fov | <input fov> <input aspect ratio|game> <output aspect ratio|game> | Converts fovs from one type to another or finds the equivilent for a differnet resolution aspect ratio | `/fov 90 16:9 quake` | -| /focal | <sens> <old fov> <new fov> | Focal Length Scales a desired sens between 2 fov values of the same type | `/focal 3 90 100` | -| /sens | <cm/360> <game|yaw> <cpi/dpi> [-cm|-deg|-inch] | Converts cm/360|deg/mm|inch/360 to a game sensitivity | `/sens 28 quake 1600 -cm` | +| Command | Arguments | Description | Example | +| -------- | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------- | +| /cm | \ \ \ | Converts Senstivity to cm/360 | `/cm 6 ow 1600` | +| /deg | \ \ \ | Converts Senstivity to deg/mm | `/deg 1.9 0.022 800` | +| /convert | \ \ \ | Converts Different Sensitivities from one game to another | `/convert 3 ow 0.022` | +| /fov | \ \ \ | Converts fovs from one type to another or finds the equivilent for a differnet resolution aspect ratio | `/fov 90 16:9 quake` | +| /focal | \ \ \ | Focal Length Scales a desired sens between 2 fov values of the same type | `/focal 3 90 100` | +| /sens | \ \ \ \[**-cm**\|**-deg**\|**-inch**\] | Converts cm/360\|deg/mm\|inch/360 to a game sensitivity | `/sens 28 quake 1600 -cm` | ### Utility Commands -| Command | Arguments | Description | Example | -| ---------- | -------------------------------------------- | --------------------------------------------------------------------------------------- | ------------------- | -| /prefix | <prefix|none|default> | Shows or sets the command prefix. | `/prefix !` | -| /help | none | Displays a list of available commands, or detailed information for a specified command. | `/help` | -| /games | none | Displays the supported games for this bot | `/games` | -| /getobject | <game> <yaw|name|fovt> | Displays the object from the array assoiated for a game | `/getobject ow yaw` | +| Command | Arguments | Description | Example | +| ---------- | ---------------------------------------- | --------------------------------------------------------------------------------------- | ------------------- | +| /prefix | \ | Shows or sets the command prefix. | `/prefix !` | +| /help | none | Displays a list of available commands, or detailed information for a specified command. | `/help` | +| /games | none | Displays the supported games for this bot | `/games` | +| /getobject | \ \<**yaw**\|**name**\|**fovt**\> | Displays the object from the array assoiated for a game | `/getobject ow yaw` | ## Supported Games ### Games -- Apex Legends (`apex`) -- Aimgods (`aimgods`) -- Call of Duty (`cod`) -- Counter Strike(`cs` or `csgo`) -- Fortnite Config (`fortnite` or `fortnite-config`) -- Overwatch (`overwatch` or `ow`) -- Quake (`quake`) -- Rainbow Six Siege (`r6`) -- Source Engine games (`source`) -- Valorant (`valorant` or `val`) -- Battlefield (`battlefield`) -- Destiny 2 (`destiny`) +- Aimgods: (`aimgods`) +- Apex Legends: (`apex-legends`, `apex`) +- Battlefield: (`battlefield`, `bf`) +- Call of Duty: (`cod`, `callofduty`, `call-of-duty`, `warzone`, `wz`) +- Counter Strike: (`cs`, `cs:go`, `csgo`) +- Destiny: (`destiny`, `d2`, `destiny2`) +- Diabotical: (`diabotical`, `dbt`) +- Fortnite: (`fornite`, `fn`) +- Fortnite config: (`fn-config`, `fornite-config`) +- Overwatch: (`overwatch`, `ow`) +- Quake: (`quake`) +- Rainbow Six: Siege: (`r6`, `rainbow6`, `r6s`) +- Source: (`source`) +- Valorant: (`valorant`, `val`) ## Built With diff --git a/index.js b/index.js index 7f7f6b8..2061088 100644 --- a/index.js +++ b/index.js @@ -65,14 +65,16 @@ client ${guild ? `in guild ${guild.name} (${guild.id})` : 'globally'}. `); }); - client.setProvider(new commando.SyncSQLiteProvider(db)); client.registry .registerGroup('math', 'Math') .registerDefaultGroups() .registerDefaultTypes() - .registerDefaultCommands({ unknownCommand: false }) + .registerDefaultCommands({ + unknownCommand: false, + help: false, + }) .registerTypesIn(path.join(__dirname, '/src/types')) .registerCommandsIn(path.join(__dirname, '/src/commands')); diff --git a/src/array.js b/src/array.js index 44213d5..a4fcdff 100644 --- a/src/array.js +++ b/src/array.js @@ -1,45 +1,88 @@ const array = [ - { name: 'aimgods', yaw: 0.0023331 }, - { name: 'source', yaw: 0.022, fovt: 0.75 }, - { name: 'csgo', yaw: 0.022, fovt: 0.75 }, - { name: 'cs', yaw: 0.022, fovt: 0.75 }, - { name: 'quake', yaw: 0.022, fovt: 0.75 }, - { name: 'apex', yaw: 0.022, fovt: 0.75 }, - { name: 'val', yaw: 0.07, fovt: 0.5625 }, - { name: 'valorant', yaw: 0.07, fovt: 0.5625 }, - { name: 'ow', yaw: 0.0066, fovt: 0.5625 }, - { name: 'overwatch', yaw: 0.0066, fovt: 0.5625 }, - { name: 'fn', yaw: 0.005555, fovt: 1 }, - { name: 'fortnite', yaw: 0.005555, fovt: 1 }, - { name: 'fn-config', yaw: 2.222, fovt: 1 }, - { name: 'fortnite-config', yaw: 2.222, fovt: 1 }, - { name: 'dbt', yaw: 0.022000000000000002, fovt: 1 }, - { name: 'r6', yaw: 0.005729577951308232, fovt: 1 }, - { name: 'cod', yaw: 0.0066, fovt: 0.5625 }, - { name: 'battlefield', yaw: 2.291831180523293, fovt: 1 }, - { name: 'destiny', yaw: 0.0066, fovt: 0.5625 }, + { name: 'Aimgods', yaw: 0.0023331, aliases: ['aimgods'] }, + { name: 'Source', yaw: 0.022, fovt: 0.75, aliases: ['source'] }, + { + name: 'Counter Strike', + yaw: 0.022, + fovt: 0.75, + aliases: ['cs', 'cs:go', 'csgo', 'counter-strike'], + }, + { name: 'Quake', yaw: 0.022, fovt: 0.75, aliases: ['quake'] }, + { + name: 'Apex Legends', + yaw: 0.022, + fovt: 0.75, + aliases: ['apex-legends', 'apex'], + }, + { name: 'Valorant', yaw: 0.07, fovt: 0.5625, aliases: ['valorant', 'val'] }, + { + name: 'Overwatch', + yaw: 0.0066, + fovt: 0.5625, + aliases: ['overwatch', 'ow'], + }, + { name: 'Fortnite', yaw: 0.005555, fovt: 1, aliases: ['fornite', 'fn'] }, + { + name: 'Fortnite config', + yaw: 2.222, + fovt: 1, + aliases: ['fn-config', 'fornite-config'], + }, + { + name: 'Diabotical', + yaw: 0.022000000000000002, + fovt: 1, + aliases: ['diabotical', 'dbt'], + }, + { + name: 'Rainbow Six: Siege', + yaw: 0.005729577951308232, + fovt: 1, + aliases: ['r6', 'rainbow6', 'r6s'], + }, + { + name: 'Call of Duty', + yaw: 0.0066, + fovt: 0.5625, + aliases: ['cod', 'callofduty', 'call-of-duty', 'warzone', 'wz'], + }, + { + name: 'Battlefield', + yaw: 2.291831180523293, + fovt: 1, + aliases: ['battlefield', 'bf'], + }, + { + name: 'Destiny', + yaw: 0.0066, + fovt: 0.5625, + aliases: ['destiny', 'd2', 'destiny2'], + }, ]; +array.sort(); + function getObject(args, object) { - const isYaw = array.some(elem => elem.name === args); + const isYaw = array.some(elem => + elem.aliases.some(currentValue => currentValue === args) + ); if (!isYaw) { return args; } else { - for (let i = 0; i < array.length; i++) { - if (args == array[i].name) { - return array[i][object]; + array.forEach(item => { + if (item.aliases.some(currentValue => currentValue === args)) { + return item[object]; } - } + }); } } function gameNames() { - let gamenames = ''; - for (let x = 0; x < array.length - 1; x++) { - gamenames += array[x].name + ', '; - } - gamenames += array[array.length - 1].name; - return gamenames; + let result = ''; + array.forEach(item => { + result += `${item.name}: (${item.aliases.join(', ')})\n`; + }); + return result; } module.exports = { diff --git a/src/commands/math/cm.js b/src/commands/math/cm.js index f7bb2fc..3c8086f 100644 --- a/src/commands/math/cm.js +++ b/src/commands/math/cm.js @@ -1,4 +1,4 @@ -const { games, getObject } = require('../../array'); +const { getObject } = require('../../array'); const commando = require('discord.js-commando'); module.exports = class cmCommand extends commando.Command { constructor(client) { @@ -8,7 +8,8 @@ module.exports = class cmCommand extends commando.Command { group: 'math', memberName: 'cm', description: 'Converts Senstivity to cm/360', - details: `Converts Senstivity to cm/360 \n (Supported Games: ${games()})`, + details: + 'Converts Senstivity to cm/360 \nTo see the Supported games do /games)', examples: ['`/cm 0.95 ow 1600`'], format: ' ', diff --git a/src/commands/math/convert.js b/src/commands/math/convert.js index ecf82ae..9fe160a 100644 --- a/src/commands/math/convert.js +++ b/src/commands/math/convert.js @@ -1,4 +1,4 @@ -const { games, getObject } = require('../../array'); +const { getObject } = require('../../array'); const commando = require('discord.js-commando'); module.exports = class convertCommand extends commando.Command { @@ -8,7 +8,8 @@ module.exports = class convertCommand extends commando.Command { group: 'math', memberName: 'convert', description: 'Converts Different Sensitivities from one game to another', - details: `Converts Different Sensitivities from one game to another \n (Supported Games: ${games()})`, + details: + 'Converts Different Sensitivities from one game to another \nTo see the Supported games do /games)', examples: ['`/convert 0.95 ow 0.022`'], format: ' ', diff --git a/src/commands/math/deg.js b/src/commands/math/deg.js index f091ca6..216dda3 100644 --- a/src/commands/math/deg.js +++ b/src/commands/math/deg.js @@ -1,4 +1,4 @@ -const { games, getObject } = require('../../array'); +const { getObject } = require('../../array'); const commando = require('discord.js-commando'); module.exports = class degCommand extends commando.Command { constructor(client) { @@ -8,7 +8,8 @@ module.exports = class degCommand extends commando.Command { group: 'math', memberName: 'deg', description: 'Converts Senstivity to deg/mm', - details: `Converts Senstivity to deg/mm \n (Supported Games: ${games()})`, + details: + 'Converts Senstivity to deg/mm \nTo see the Supported games do /games)', examples: ['`/deg 0.95 ow 1600`'], format: ' ', diff --git a/src/commands/math/fov.js b/src/commands/math/fov.js index d716460..4ad6ac7 100644 --- a/src/commands/math/fov.js +++ b/src/commands/math/fov.js @@ -1,6 +1,6 @@ const { atan, tan } = require('mathjs'); const PI = 3.14159; -const { games, getObject } = require('../../array'); +const { getObject } = require('../../array'); const commando = require('discord.js-commando'); module.exports = class fovCommand extends commando.Command { constructor(client) { @@ -11,7 +11,8 @@ module.exports = class fovCommand extends commando.Command { memberName: 'fov', description: 'Converts fovs from one type to another or finds the true fov for a resolution aspect ratio', - details: `Converts fovs from one type to another or finds the true fov for a resolution aspect ratio(if the game scales to maintain vFOV) \n(Supported Games: ${games()})`, + details: + 'Converts fovs from one type to another or finds the true fov for a resolution aspect ratio(if the game scales to maintain vFOV) \nTo see the Supported games do /games)', examples: ['`/fov 90 quake 16:9`'], format: ' ', diff --git a/src/commands/math/inch.js b/src/commands/math/inch.js new file mode 100644 index 0000000..0c976b1 --- /dev/null +++ b/src/commands/math/inch.js @@ -0,0 +1,45 @@ +const { getObject } = require('../../array'); +const commando = require('discord.js-commando'); +module.exports = class inchCommand extends commando.Command { + constructor(client) { + super(client, { + name: 'inch', + aliases: ['inch/360', 'inch/rev'], + group: 'math', + memberName: 'inch', + description: 'Converts Senstivity to inch/360', + details: + 'Converts Senstivity to inch/360 \nTo see the Supported games do /games', + examples: ['`/inch 0.95 ow 1600`'], + format: ' ', + + args: [ + { + key: 'sens', + prompt: 'What Sensitivity do you want to convert from', + type: 'float', + }, + { + key: 'yawv', + label: 'Game or yaw value', + prompt: 'What game or yaw value do you want to use', + type: 'gamename|float', + }, + { + key: 'cpi', + label: 'cpi/dpi', + prompt: 'What CPI/DPI do you want to use', + type: 'float', + }, + ], + }); + } + + async run(message, args) { + const output = ( + 360 / + (args.cpi * getObject(args.yawv, 'yaw') * args.sens) + ).toFixed(2); + return message.say(output + ' inch/360'); + } +}; diff --git a/src/commands/math/sens.js b/src/commands/math/sens.js index 0dd65cb..987f0fc 100644 --- a/src/commands/math/sens.js +++ b/src/commands/math/sens.js @@ -1,4 +1,4 @@ -const { games, getObject } = require('../../array'); +const { getObject } = require('../../array'); const commando = require('discord.js-commando'); module.exports = class sensCommand extends commando.Command { constructor(client) { @@ -7,15 +7,18 @@ module.exports = class sensCommand extends commando.Command { aliases: ['sens-cm', 'sens-deg', 'sens-inch'], group: 'math', memberName: 'sens', - description: 'Converts cm/360|deg/mm|inch/360 to a game sensitivity', - details: `Converts cm/360|deg/mm|inch/360 to a game sensitivity \n(Supported Games: ${games()})`, + description: + 'Converts cm/360(default), deg/mm or inch/360 to a game sensitivity', + details: + 'Converts cm/360(default), deg/mm or inch/360 to a game sensitivity \nTo see the Supported games do /games', examples: [ '`/sens 28.5 quake 1600`', '`/sens 28.5 ow 1600 -cm`', '`/sens 1.21 cs 1600 -deg`', '`/sens 11.22 fortnite 1600 -inch`', ], - format: ' [-cm|-deg|-inch]', + format: + ' ["-cm"|"-deg"|"-inch"]', args: [ { @@ -51,7 +54,7 @@ module.exports = class sensCommand extends commando.Command { case '-deg': { const output = ( (24.5 * args.cm) / - (args.cpi * getObject(args.yawv, 'yaw')) + (args.cpi * getObject(args.yawv.toLowerCase(), 'yaw')) ).toFixed(2); console.log(output); message.say(output); @@ -61,7 +64,7 @@ module.exports = class sensCommand extends commando.Command { case '-inch': { const output = ( 360 / - (args.cpi * getObject(args.yawv, 'yaw') * args.cm) + (args.cpi * getObject(args.yawv.toLowerCase(), 'yaw') * args.cm) ).toFixed(2); message.say(output); break; @@ -70,7 +73,7 @@ module.exports = class sensCommand extends commando.Command { case '-cm': { const output = ( (2.54 * 360) / - (args.cpi * getObject(args.yawv, 'yaw') * args.cm) + (args.cpi * getObject(args.yawv.toLowerCase(), 'yaw') * args.cm) ).toFixed(2); message.say(output); } diff --git a/src/commands/util/games.js b/src/commands/util/games.js index 6f32a94..1c1e8b7 100644 --- a/src/commands/util/games.js +++ b/src/commands/util/games.js @@ -1,5 +1,7 @@ const { games } = require('../../array'); const commando = require('discord.js-commando'); +const discord = require('discord.js'); + module.exports = class gamesCommand extends commando.Command { constructor(client) { super(client, { @@ -12,6 +14,9 @@ module.exports = class gamesCommand extends commando.Command { } async run(message) { - return message.say(`Suported Games: ${games()}`); + const Embed = new discord.MessageEmbed() + .setColor('#0099ff') + .addField('Supported Games:', `\`\`\`${games()}\`\`\``); + return message.say(Embed); } }; diff --git a/src/commands/util/getobject.js b/src/commands/util/getobject.js index 98ceecc..1faef67 100644 --- a/src/commands/util/getobject.js +++ b/src/commands/util/getobject.js @@ -1,4 +1,4 @@ -const { getObject, games } = require('../../array'); +const { getObject } = require('../../array'); const commando = require('discord.js-commando'); module.exports = class getObjectCommand extends commando.Command { constructor(client) { @@ -7,8 +7,11 @@ module.exports = class getObjectCommand extends commando.Command { group: 'util', memberName: 'getobject', description: 'Displays the object assoiated for a game', - details: `Displays the object assoiated for a game \n(Supported games: ${games()}), (Supported Objects: fovt, yaw)`, + details: + 'Displays the object assoiated for a game \nTo see the Supported games do /games, (Supported Objects: fovt, yaw, name)', examples: ['`/getobject ow yaw`'], + format: ' <"yaw"|"name"|"fovt">', + args: [ { key: 'game', diff --git a/src/commands/util/help.js b/src/commands/util/help.js new file mode 100644 index 0000000..82ff178 --- /dev/null +++ b/src/commands/util/help.js @@ -0,0 +1,205 @@ +const { stripIndents, oneLine } = require('common-tags'); +const commando = require('discord.js-commando'); +const { disambiguation } = require('discord.js-commando'); +const discord = require('discord.js'); + +module.exports = class HelpCommand extends commando.Command { + constructor(client) { + super(client, { + name: 'help', + group: 'util', + memberName: 'help', + aliases: ['commands'], + description: + 'Displays a list of available commands, or detailed information for a specified command.', + details: oneLine` + The command may be part of a command name or a whole command name. + If it isn't specified, all available commands will be listed. + `, + examples: ['help', 'help prefix'], + format: '`[command]`', + + guarded: true, + + args: [ + { + key: 'command', + prompt: 'Which command would you like to view the help for?', + type: 'string', + default: '', + }, + ], + }); + } + + async run(msg, args) { + const groups = this.client.registry.groups; + const commands = this.client.registry.findCommands( + args.command, + false, + msg + ); + const showAll = args.command && args.command.toLowerCase() === 'all'; + if (args.command && !showAll) { + if (commands.length === 1) { + const commandhelpEmbed = new discord.MessageEmbed() + .setTitle(`Command Help - ${commands[0].name}`) + .setColor('#0099ff') + .setDescription( + stripIndents`${oneLine` + ${commands[0].description} + ${commands[0].guildOnly ? ' (Usable only in servers)' : ''} + ${commands[0].nsfw ? ' (NSFW)' : ''} + + `} + Key: [optional] \"exact\"` + ) + .addField( + 'Format', + stripIndents`${msg.anyUsage( + `${commands[0].name}${ + commands[0].format ? ` ${commands[0].format}` : '' + }` + )}` + ); + if (commands[0].aliases.length > 0) { + commandhelpEmbed.addField('Aliases', commands[0].aliases.join(', ')); + } + commandhelpEmbed.addField( + 'Group', + stripIndents`${oneLine` + **Group:** ${commands[0].group.name} + (\`${commands[0].groupID}:${commands[0].memberName}\`) + `}` + ); + if (commands[0].details) { + commandhelpEmbed.addField('Details', commands[0].details); + } + if (commands[0].examples) { + commandhelpEmbed.addField( + 'Examples', + `${commands[0].examples.join('\n')}` + ); + } + commandhelpEmbed.addField( + 'Quick Links', + // eslint-disable-next-line prettier/prettier + '[**Github/ README.md**](https://github.com/animafps/fpsmath) | [**Invite to your server**](https://discordapp.com/api/oauth2/authorize?client_id=792712521546465301&scope=bot&permissions=10240) | [**Dev\'s Twitter**](https://twitter.com/animafps)' + ); + const messages = []; + try { + messages.push(await msg.direct(commandhelpEmbed)); + if (msg.channel.type !== 'dm') { + messages.push(await msg.reply('Sent you a DM with information.')); + } + } catch (err) { + console.log(err); + messages.push( + await msg.reply( + 'Unable to send you the help DM. You probably have DMs disabled.' + ) + ); + } + return messages; + } else if (commands.length > 15) { + return msg.reply('Multiple commands found. Please be more specific.'); + } else if (commands.length > 1) { + return msg.reply(disambiguation(commands, 'commands')); + } else { + return msg.reply( + `Unable to identify command. Use ${msg.usage( + null, + msg.channel.type === 'dm' ? null : undefined, + msg.channel.type === 'dm' ? null : undefined + )} to view the list of all commands.` + ); + } + } else { + const messages = []; + try { + const generalhelpEmbed = new discord.MessageEmbed() + .setTitle('FPSMath Help') + .setColor('#0099ff') + .setDescription( + stripIndents` + Global Prefix: **${this.client.commandPrefix}** + ${oneLine` + To run a command in ${ + msg.guild ? msg.guild.name : 'any server' + }, + use **${commando.Command.usage( + '', + msg.guild ? msg.guild.commandPrefix : null, + this.client.user + )}**. + For example, **${commando.Command.usage( + 'prefix', + msg.guild ? msg.guild.commandPrefix : null, + this.client.user + )}**. + `} + To run a command in this DM, simply use ${commando.Command.usage( + 'command', + null, + null + )} with no prefix. + Use ${this.usage( + '', + null, + null + )} to view detailed information about a specific command. + Use ${this.usage( + 'all', + null, + null + )} to view a list of *all* commands, not just available ones. + \n + __**${ + showAll + ? 'All commands' + : `Available commands in ${msg.guild || 'this DM'}:` + }**__ + ` + ); + groups + .filter(grp => + grp.commands.some( + cmd => !cmd.hidden && (showAll || cmd.isUsable(msg)) + ) + ) + .forEach(grp => + generalhelpEmbed.addField( + grp.name, + `\`\`\`${grp.commands + .filter(cmd => !cmd.hidden && (showAll || cmd.isUsable(msg))) + .map( + cmd => + `${cmd.name}: ${cmd.description}${ + cmd.nsfw ? ' (NSFW)' : '' + }` + ) + .join('\n')}\`\`\`` + ) + ); + generalhelpEmbed.addField( + 'Quick Links', + // eslint-disable-next-line prettier/prettier + '[**Github/ README.md**](https://github.com/animafps/fpsmath) | [**Invite to your server**](https://discordapp.com/api/oauth2/authorize?client_id=792712521546465301&scope=bot&permissions=10240) | [**Dev\'s Twitter**](https://twitter.com/animafps)' + ); + messages.push(await msg.direct(generalhelpEmbed)); + + if (msg.channel.type !== 'dm') { + messages.push(await msg.reply('Sent you a DM with information.')); + } + } catch (err) { + console.log(err); + messages.push( + await msg.reply( + 'Unable to send you the help DM. You probably have DMs disabled.' + ) + ); + } + return messages; + } + } +};