diff --git a/model/command/clean.js b/model/command/clean.js index 956802b..6e17c69 100644 --- a/model/command/clean.js +++ b/model/command/clean.js @@ -15,7 +15,7 @@ class Clean this.aliases = ['clear', 'purge']; this.category = CommandCategory.MODERATION; this.isAllowedForContext = CommandPermission.isMemberMod; - this.description = 'Kills the bot process'; + this.description = 'Deletes messages in a bulk.'; } /** diff --git a/model/command/custom-fields.js b/model/command/custom-fields.js new file mode 100644 index 0000000..1f88830 --- /dev/null +++ b/model/command/custom-fields.js @@ -0,0 +1,39 @@ +const { MessageEmbed } = require('discord.js'); +const CommandCategory = require('../command-category'); +const CommandPermission = require('../command-permission'); + +class CustomFields +{ + static instance = null; + + constructor() { + if (CustomFields.instance !== null) { + return CustomFields.instance; + } + + this.aliases = ['custom-fields', 'customfields', 'customfield', 'cfi']; + this.category = CommandCategory.RESOURCE; + this.isAllowedForContext = CommandPermission.yes; + this.description = 'Talks about the "custom fields" feature.'; + } + + /** + * @param {Message} message + * @param {Array} args + */ + async process(message, args) { + const embed = new MessageEmbed(); + + embed.setColor(APP_MAIN_COLOUR); + embed.setAuthor('Custom fields', bot.user.displayAvatarURL({ dynamic: true })); + embed.setDescription( + 'The ability to change the fields shown on your member lists is planned. This feature will also bring ' + + 'the ability to remove and add fields, as well as make fields private, public, or show them to only ' + + 'trusted friends.' + ); + + return message.channel.send(embed); + } +} + +module.exports = new CustomFields(); diff --git a/model/command/custom-front.js b/model/command/custom-front.js index b0d5b3b..6ccb019 100644 --- a/model/command/custom-front.js +++ b/model/command/custom-front.js @@ -12,7 +12,7 @@ class CustomFront } this.aliases = ['custom-fronts', 'customfronts', 'customfront', 'cf']; - this.category = CommandCategory.FUN; + this.category = CommandCategory.RESOURCE; this.isAllowedForContext = CommandPermission.yes; this.description = 'Explains what "custom front" is.'; } diff --git a/model/command/front-history-importing.js b/model/command/front-history-importing.js new file mode 100644 index 0000000..c1b0028 --- /dev/null +++ b/model/command/front-history-importing.js @@ -0,0 +1,53 @@ +const { MessageEmbed } = require('discord.js'); +const CommandCategory = require('../command-category'); +const CommandPermission = require('../command-permission'); + +class FrontHistoryImporting +{ + static instance = null; + + constructor() { + if (FrontHistoryImporting.instance !== null) { + return FrontHistoryImporting.instance; + } + + this.aliases = [ + 'fronthistoryimporting', + 'fronthistory-importing', + 'front-historyimporting', + 'fronthistoryimport', + 'fronthistory-import', + 'front-historyimport', + 'front-history', + 'fronthistory', + 'front-importing', + 'frontimporting', + 'front-import', + 'frontimport', + 'fhi', + ]; + this.category = CommandCategory.RESOURCE; + this.isAllowedForContext = CommandPermission.yes; + this.description = 'Talks about importing the front history from PluralKit.'; + } + + /** + * @param {Message} message + * @param {Array} args + */ + async process(message, args) { + const embed = new MessageEmbed(); + + embed.setColor(APP_MAIN_COLOUR); + embed.setAuthor('Front history importing', bot.user.displayAvatarURL({ dynamic: true })); + embed.setDescription( + 'Importing your front history from PluralKit is planned in the future, but is currently impossible ' + + 'until APIv2 for PluralKit is finished. This feature also takes a lower priority than features unique ' + + 'to Simply Plural.' + ); + + return message.channel.send(embed); + } +} + +module.exports = new FrontHistoryImporting(); diff --git a/model/command/help.js b/model/command/help.js index d7b596f..5219c09 100644 --- a/model/command/help.js +++ b/model/command/help.js @@ -24,9 +24,19 @@ class HelpDialog this.categoriesEmbed = new Discord.MessageEmbed(); this.originalMessage = message; this.categoryCommandMapping = new Discord.Collection(); + this.categoryColourMapping = new Discord.Collection(); this.postedMessage = null; this.usedEmojis = []; this.stopAddingReactions = false; + + this.categoriesEmbed.setColor(APP_MAIN_COLOUR); + this.categoriesEmbed.setFooter('Click on one of the reactions below'); + + for (let category of Object.values(CommandCategory)) { + this.categoryColourMapping.set(category, APP_MAIN_COLOUR); + } + + this.categoryColourMapping.set(CommandCategory.RESOURCE, 'fdfd96'); } /** @@ -71,7 +81,16 @@ class HelpDialog }, ''); this.categoriesEmbed.setTitle('Help command'); - this.categoriesEmbed.setDescription(categories); + this.categoriesEmbed.setDescription( + 'Spot stands for **S**imply **P**lural b**ot**. This bot is mainly used to generate changelogs and help ' + + 'with the definition of features, so recurring questions can be answered more quickly.\n' + + '\n' + + 'Commands are classified by categories because displaying every command in this small box would be ' + + 'confusing and would break Discord\'s character limit. Click on a reaction to show the commands ' + + 'available in the corresponding category.\n' + + '\n' + + categories + ); return this.listCategories(); } @@ -139,6 +158,8 @@ class HelpDialog commandsEmbed.setTitle('Help command'); commandsEmbed.setDescription(commands); + commandsEmbed.setColor(this.categoryColourMapping.get(category)); + commandsEmbed.setFooter('Click on one of the reactions below'); this.postedMessage.edit('', commandsEmbed); @@ -158,7 +179,7 @@ class Help return Help.instance; } - this.aliases = []; + this.aliases = ['commands']; this.category = CommandCategory.INFO; this.isAllowedForContext = CommandPermission.yes; this.description = 'Provides the list of commands'; diff --git a/model/command/system-relationships.js b/model/command/system-relationships.js new file mode 100644 index 0000000..62da561 --- /dev/null +++ b/model/command/system-relationships.js @@ -0,0 +1,40 @@ +const { MessageEmbed } = require('discord.js'); +const CommandCategory = require('../command-category'); +const CommandPermission = require('../command-permission'); + +class SystemRelationships +{ + static instance = null; + + constructor() { + if (SystemRelationships.instance !== null) { + return SystemRelationships.instance; + } + + this.aliases = ['system-relationship', 'systemrelationships', 'systemrelationships', 'sr']; + this.category = CommandCategory.RESOURCE; + this.isAllowedForContext = CommandPermission.yes; + this.description = 'Explains what "system relationships" are.'; + } + + /** + * @param {Message} message + * @param {Array} args + */ + async process(message, args) { + const embed = new MessageEmbed(); + + embed.setColor(APP_MAIN_COLOUR); + embed.setAuthor('System relationships', bot.user.displayAvatarURL({ dynamic: true })); + embed.setDescription( + 'This is an open-ended field meant to describe what relationships a headmate has. It can be used to ' + + 'describe the member\'s relationship to the system as a whole, their inner system relationships such as ' + + 'being family, friends, or romantic partners, or it can describe their outer-system relationships with ' + + 'people in the outer world, such as family, friends, and romantic partners.' + ); + + return message.channel.send(embed); + } +} + +module.exports = new SystemRelationships();