From 15a9a6fc771dfdb2b40a4437210e9b82f96bad30 Mon Sep 17 00:00:00 2001 From: Nathaniel Tseng Date: Sat, 3 Apr 2021 13:33:06 -0700 Subject: [PATCH 1/5] 2.3 Improvement - store patron ids in separate file --- .gitignore | 1 + Commands/mydata.js | 19 +++++++------------ SET-UP INSTRUCTIONS.txt | 3 ++- Templates/patrons_template.json | 10 ++++++++++ 4 files changed, 20 insertions(+), 13 deletions(-) create mode 100644 Templates/patrons_template.json diff --git a/.gitignore b/.gitignore index 186979a..fee7f1d 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ /guildsList.txt /encryptionKey.txt versionData.json +patrons.json diff --git a/Commands/mydata.js b/Commands/mydata.js index 5c30074..7cb9f3d 100644 --- a/Commands/mydata.js +++ b/Commands/mydata.js @@ -2,6 +2,7 @@ const Command = require('./../Classes/Command.js'); const { getString } = require('./../Localizations/localization.js'); const { MessageEmbed } = require('discord.js'); const { directories } = require('../helpers.js'); +const patrons = require('./../patrons.json'); var command = new Command("mydata", false, false, false); @@ -18,24 +19,18 @@ command.execute = (receivedMessage, state, locale) => { Object.keys(dictionary).forEach(platform => { text += `\n${platform}: ${dictionary[platform].value ? dictionary[platform].value : ''}`; }) - let observers = []; - let dreamers = []; - let explorers = ['103335856479162368']; - let cartographers = ['115221369339379720']; - let archivists = [] - let grandArchivists = ['694403611979153488', '106122478715150336', '112785244733628416']; - if (observers.includes(receivedMessage.author.id)) { // Observer + if (patrons.observers.includes(receivedMessage.author.id)) { // Observer embed.setImage('https://cdn.discordapp.com/attachments/545684759276421120/734114192013000816/IH_PatreonTierImages_Observer.jpg'); - } else if (dreamers.includes(receivedMessage.author.id)) { // Dreamer + } else if (patrons.dreamers.includes(receivedMessage.author.id)) { // Dreamer embed.setImage('https://cdn.discordapp.com/attachments/545684759276421120/734114186811932713/IH_PatreonTierImages_Dreamer.jpg'); - } else if (explorers.includes(receivedMessage.author.id)) { // Explorer + } else if (patrons.explorers.includes(receivedMessage.author.id)) { // Explorer embed.setImage('https://cdn.discordapp.com/attachments/545684759276421120/734114188095651840/IH_PatreonTierImages_Explorer.jpg'); - } else if (cartographers.includes(receivedMessage.author.id)) { // Cartographer + } else if (patrons.cartographers.includes(receivedMessage.author.id)) { // Cartographer embed.setImage('https://cdn.discordapp.com/attachments/545684759276421120/734114184685420615/IH_PatreonTierImages_Cartographer_.jpg'); - } else if (archivists.includes(receivedMessage.author.id)) { // Archivist + } else if (patrons.archivists.includes(receivedMessage.author.id)) { // Archivist embed.setImage('https://cdn.discordapp.com/attachments/545684759276421120/734114183620067358/IH_PatreonTierImages_Archivist.jpg'); - } else if (grandArchivists.includes(receivedMessage.author.id)) { // Grand Archivist + } else if (patrons.grandArchivists.includes(receivedMessage.author.id)) { // Grand Archivist embed.setImage('https://cdn.discordapp.com/attachments/545684759276421120/734114189710327818/IH_PatreonTierImages_Grand_Archivist.jpg'); } diff --git a/SET-UP INSTRUCTIONS.txt b/SET-UP INSTRUCTIONS.txt index 15b3d7a..e331ab6 100644 --- a/SET-UP INSTRUCTIONS.txt +++ b/SET-UP INSTRUCTIONS.txt @@ -1,4 +1,5 @@ 1. Create a file named encryptionKey.txt in the directory you will be running bot.js from and decide on an encryption key 2. Copy authentication_template.json, and versionData_template.json from './Templates' into the directory you will be running bot.js from 3. Open authentication_template.json: provide bot token, then remove "_template" from filename -4. Open versionData.json: populate data, then remove "_template" from filename \ No newline at end of file +4. Open versionData.json: populate data, then remove "_template" from filename +5. Open patrons.json: populate data, then remove "_template" from filename \ No newline at end of file diff --git a/Templates/patrons_template.json b/Templates/patrons_template.json new file mode 100644 index 0000000..4cfc7f4 --- /dev/null +++ b/Templates/patrons_template.json @@ -0,0 +1,10 @@ +{ + "observers": [], + "dreamers": [], + "explorers": [], + "cartographers": [], + "archivists": [], + "grandArchivists": [], + "developers": [], + "giftPremium": [] +} \ No newline at end of file From 94a4f56004535f3e46178a0a780161567c124b4f Mon Sep 17 00:00:00 2001 From: Nathaniel Tseng Date: Tue, 20 Apr 2021 13:51:29 -0700 Subject: [PATCH 2/5] Updated patrons --- Commands/about.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Commands/about.js b/Commands/about.js index ac1fe72..f008062 100644 --- a/Commands/about.js +++ b/Commands/about.js @@ -29,7 +29,7 @@ function creditsBuilder(footerURL, locale) { .addField(getString(locale, command.module, "localization"), `Mnemmy (fr), towoko (de), Lille (de)`) .addField(`Embed Thumbnails`, `[game-icons.net](https://game-icons.net/)`) .addField(`\u200B`, getString(locale, command.module, "patronsDescription")) - .addField(getString(locale, command.module, "grandArchivistTier"), "Victor Huang", false) + .addField(getString(locale, command.module, "archivistTier"), "Victor Huang", false) .addField(getString(locale, command.module, "cartographerTier"), `Ralph Beish`, false) .addField(getString(locale, command.module, "explorerTier"), `Eric Hu`, false) .setFooter(getString(locale, "DirectoryBot", "footerText"), footerURL) From 31c308b0b1cfb3d4e02a6a262d5ff9e8d703cd29 Mon Sep 17 00:00:00 2001 From: Nathaniel Tseng Date: Sat, 31 Jul 2021 16:15:45 -0700 Subject: [PATCH 3/5] 2.3 Improvement - support refactor (#229) --- Classes/Command.js | 6 +++-- Commands/CommandsList.js | 2 +- Commands/about.js | 6 +++-- Commands/datapolicy.js | 6 +++-- Commands/getstarted.js | 6 +++-- Commands/help.js | 8 ++++--- Commands/lookup.js | 12 +++++----- Commands/mydata.js | 7 +++--- Commands/setlocale.js | 7 +++--- Commands/support.js | 33 ---------------------------- Localizations/de.json | 27 ++++++----------------- Localizations/en-US.json | 29 +++++++----------------- Localizations/fr.json | 29 +++++++----------------- Templates/localization_template.json | 27 ++++++----------------- helpers.js | 30 +++++++++++++++++++++++-- 15 files changed, 95 insertions(+), 140 deletions(-) delete mode 100644 Commands/support.js diff --git a/Classes/Command.js b/Classes/Command.js index 68edcad..de7f7ec 100644 --- a/Classes/Command.js +++ b/Classes/Command.js @@ -1,4 +1,5 @@ const { MessageEmbed } = require('discord.js'); +const { tipBuilder } = require('../helpers.js'); const { getString } = require('./../Localizations/localization.js'); module.exports = class Command { @@ -10,11 +11,12 @@ module.exports = class Command { } help(avatarURL, guildID, locale, guildName, module) { - let embed = new MessageEmbed().setAuthor("Imaginary Horizons Productions", `https://cdn.discordapp.com/icons/353575133157392385/c78041f52e8d6af98fb16b8eb55b849a.png `, `https://discord.gg/FJ8JGq2`) + var tip = tipBuilder(locale); + let embed = new MessageEmbed().setAuthor(tip.text, avatarURL, tip.url) .setThumbnail('https://cdn.discordapp.com/attachments/545684759276421120/765061579619565588/magnifying-glass.png') .setTitle(getString(locale, "DirectoryBot", "directoryBotCommand") + getString(locale, module, "names").join(', ')) .setDescription(getString(locale, module, "description")) - .setFooter(getString(locale, "DirectoryBot", "footerText"), avatarURL); + .setFooter(getString(locale, "DirectoryBot", "footerText"), `https://cdn.discordapp.com/icons/353575133157392385/c78041f52e8d6af98fb16b8eb55b849a.png `); embed.addField(getString(locale, "DirectoryBot", "commandProperties"), getString(locale, "DirectoryBot", "propertiesText").addVariables({ "premium": this.premiumCommand ? ":white_check_mark:" : ":no_entry_sign:", diff --git a/Commands/CommandsList.js b/Commands/CommandsList.js index c721dae..68ddc32 100644 --- a/Commands/CommandsList.js +++ b/Commands/CommandsList.js @@ -4,7 +4,7 @@ const { getString, dictionary } = require('./../Localizations/localization.js'); // The help command supports a maximum of 25 command sets to conform with MessageEmbed limit of 25 fields let generalCommands = new CommandSet("generalCommands", false, ['record.js', 'import.js', 'tell.js', 'lookup.js', 'mydata.js', 'whois.js', 'delete.js', 'block.js', 'platforms.js', 'raffle.js', "feedback.js"]); -let infoCommands = new CommandSet("infoCommands", false, ['getstarted.js', 'about.js', 'help.js', 'support.js', 'datapolicy.js', 'version.js']); +let infoCommands = new CommandSet("infoCommands", false, ['getstarted.js', 'about.js', 'help.js', 'datapolicy.js', 'version.js']); let timezoneCommands = new CommandSet("timeZoneCommands", false, ['convert.js', 'countdown.js']); let streamCommands = new CommandSet("streamCommands", false, ['multistream.js', 'shoutout.js']); let configCommands = new CommandSet("configCommands", true, ['permissionsrole.js', 'setlocale.js', 'datalifetime.js', 'newplatform.js', 'setplatformterm.js', 'setplatformrole.js', 'removeplatform.js']); diff --git a/Commands/about.js b/Commands/about.js index f008062..a6e8c22 100644 --- a/Commands/about.js +++ b/Commands/about.js @@ -1,6 +1,7 @@ const Command = require('../Classes/Command.js'); const { getString } = require('../Localizations/localization.js'); const { MessageEmbed } = require('discord.js'); +const { tipBuilder } = require('../helpers.js'); var command = new Command("about", false, false, true); @@ -18,8 +19,9 @@ command.execute = (receivedMessage, state, locale) => { module.exports = command; function creditsBuilder(footerURL, locale) { + var tip = tipBuilder(locale); return new MessageEmbed().setColor(`6b81eb`) - .setAuthor("Imaginary Horizons Productions", `https://cdn.discordapp.com/icons/353575133157392385/c78041f52e8d6af98fb16b8eb55b849a.png `, `https://discord.gg/FJ8JGq2`) + .setAuthor(tip.text, footerURL, tip.url) .setTitle(getString(locale, command.module, "creditsTitle")) .setThumbnail('https://cdn.discordapp.com/attachments/545684759276421120/734097014974971924/theater-curtains.png') .setURL(`https://github.com/Imaginary-Horizons-Productions/DirectoryBot `) @@ -32,6 +34,6 @@ function creditsBuilder(footerURL, locale) { .addField(getString(locale, command.module, "archivistTier"), "Victor Huang", false) .addField(getString(locale, command.module, "cartographerTier"), `Ralph Beish`, false) .addField(getString(locale, command.module, "explorerTier"), `Eric Hu`, false) - .setFooter(getString(locale, "DirectoryBot", "footerText"), footerURL) + .setFooter(getString(locale, "DirectoryBot", "footerText"), `https://cdn.discordapp.com/icons/353575133157392385/c78041f52e8d6af98fb16b8eb55b849a.png `) .setTimestamp(); } diff --git a/Commands/datapolicy.js b/Commands/datapolicy.js index 9d7ca42..5c0ab54 100644 --- a/Commands/datapolicy.js +++ b/Commands/datapolicy.js @@ -1,6 +1,7 @@ const Command = require('../Classes/Command.js'); const { getString } = require('../Localizations/localization.js'); const { MessageEmbed } = require('discord.js'); +const { tipBuilder } = require('../helpers.js'); var command = new Command("datapolicy", false, false, true); @@ -17,14 +18,15 @@ command.execute = (receivedMessage, state, locale) => { module.exports = command; function dataPolicyBuilder(locale, footerURL) { + var tip = tipBuilder(locale); return new MessageEmbed().setColor(`6b81eb`) - .setAuthor("Imaginary Horizons Productions", `https://cdn.discordapp.com/icons/353575133157392385/c78041f52e8d6af98fb16b8eb55b849a.png `, `https://discord.gg/FJ8JGq2`) + .setAuthor(tip.text, footerURL, tip.url) .setURL(`https://github.com/Imaginary-Horizons-Productions/DirectoryBot `) .setTitle(getString(locale, command.module, "embedTitle")) .setThumbnail('https://cdn.discordapp.com/attachments/545684759276421120/782019073562378298/shaking-hands.png') .setDescription(getString(locale, command.module, "embedDescription")) .addField(getString(locale, command.module, "collectionHeader"), getString(locale, command.module, "collectionText")) .addField(getString(locale, command.module, "usageHeader"), getString(locale, command.module, "usageText")) - .setFooter(getString(locale, "DirectoryBot", "footerText"), footerURL) + .setFooter(getString(locale, "DirectoryBot", "footerText"), `https://cdn.discordapp.com/icons/353575133157392385/c78041f52e8d6af98fb16b8eb55b849a.png `) .setTimestamp(); } diff --git a/Commands/getstarted.js b/Commands/getstarted.js index 02e4825..8ce1c12 100644 --- a/Commands/getstarted.js +++ b/Commands/getstarted.js @@ -1,6 +1,7 @@ const Command = require('../Classes/Command.js'); const { getString } = require('../Localizations/localization.js'); const { MessageEmbed } = require('discord.js'); +const { tipBuilder } = require('../helpers.js'); var command = new Command("getstarted", false, false, true); @@ -17,11 +18,12 @@ command.execute = (receivedMessage, state, locale) => { module.exports = command; function getStartedBuilder(footerURL, locale, botManager) { + var tip = tipBuilder(locale); let embed = new MessageEmbed().setColor('6b81eb') - .setAuthor("Imaginary Horizons Productions", `https://cdn.discordapp.com/icons/353575133157392385/c78041f52e8d6af98fb16b8eb55b849a.png `, `https://discord.gg/FJ8JGq2`) + .setAuthor(tip.text, footerURL, tip.url) .setTitle(getString(locale, command.module, "embedTitle")) .setThumbnail(footerURL) - .setFooter(getString(locale, "DirectoryBot", "footerText"), footerURL) + .setFooter(getString(locale, "DirectoryBot", "footerText"), `https://cdn.discordapp.com/icons/353575133157392385/c78041f52e8d6af98fb16b8eb55b849a.png `) .setTimestamp(); if (botManager) { diff --git a/Commands/help.js b/Commands/help.js index 6b3acf7..5c7aaa0 100644 --- a/Commands/help.js +++ b/Commands/help.js @@ -1,6 +1,7 @@ const Command = require('./../Classes/Command.js'); const { getString } = require('./../Localizations/localization.js'); const { MessageEmbed } = require('discord.js'); +const { tipBuilder } = require('../helpers.js'); var command = new Command("help", false, false, true); @@ -30,16 +31,17 @@ command.execute = (receivedMessage, state, locale) => { } }) } else { + var tip = tipBuilder(locale); let titleString = getString(locale, command.module, "embedTitle"); let descriptionString = getString(locale, command.module, "embedDescription"); let footerString = getString(locale, "DirectoryBot", "footerText"); - let totalCharacterCount = "Imaginary Horizons Productions".length + titleString.length + descriptionString.length + footerString.length; + let totalCharacterCount = tip.text.length + titleString.length + descriptionString.length + footerString.length; var embed = new MessageEmbed().setColor('6b81eb') - .setAuthor("Imaginary Horizons Productions", `https://cdn.discordapp.com/icons/353575133157392385/c78041f52e8d6af98fb16b8eb55b849a.png `, `https://discord.gg/FJ8JGq2`) + .setAuthor(tip.text, receivedMessage.client.user.displayAvatarURL(), tip.url) .setTitle(titleString) .setThumbnail('https://cdn.discordapp.com/attachments/545684759276421120/765059662268727326/info.png') .setDescription(descriptionString) - .setFooter(footerString, receivedMessage.client.user.displayAvatarURL()) + .setFooter(footerString, `https://cdn.discordapp.com/icons/353575133157392385/c78041f52e8d6af98fb16b8eb55b849a.png `) .setTimestamp(); for (commandSet of commandSets) { if (state.botManager || !commandSet.managerCommand) { diff --git a/Commands/lookup.js b/Commands/lookup.js index 3996f83..d036a40 100644 --- a/Commands/lookup.js +++ b/Commands/lookup.js @@ -1,16 +1,17 @@ const Command = require('./../Classes/Command.js'); const { getString } = require('./../Localizations/localization.js'); const { MessageEmbed, MessageMentions } = require('discord.js'); -const { directories, millisecondsToHours, platformsBuilder } = require('./../helpers.js'); +const { directories, millisecondsToHours, platformsBuilder, tipBuilder } = require('./../helpers.js'); var command = new Command("lookup", false, false, false); // Generate embed on call to add up-to-date list of platforms command.help = (avatarURL, guildID, locale, guildName, module) => { - let embed = new MessageEmbed().setAuthor("Imaginary Horizons Productions", `https://cdn.discordapp.com/icons/353575133157392385/c78041f52e8d6af98fb16b8eb55b849a.png `, `https://discord.gg/FJ8JGq2`) + var tip = tipBuilder(locale); + let embed = new MessageEmbed().setAuthor(tip.text, avatarURL, tip.url) .setTitle(getString(locale, "DirectoryBot", "directoryBotCommand") + getString(locale, module, "names").join(', ')) .setDescription(getString(locale, module, "description")) - .setFooter(getString(locale, "DirectoryBot", "footerText"), avatarURL); + .setFooter(getString(locale, "DirectoryBot", "footerText"), `https://cdn.discordapp.com/icons/353575133157392385/c78041f52e8d6af98fb16b8eb55b849a.png `); let headers = getString(locale, module, "headers"); let texts = getString(locale, module, "texts"); @@ -49,12 +50,13 @@ command.execute = (receivedMessage, state, locale) => { }) if (text.length < 2049) { + var tip = tipBuilder(locale); let embed = new MessageEmbed().setColor(`6b81eb`) - .setAuthor(receivedMessage.guild.name, receivedMessage.guild.iconURL()) + .setAuthor(tip.text, receivedMessage.client.user.avatarURL(), tip.url) .setTitle(`${state.command}: ${platform}`) .setThumbnail('https://cdn.discordapp.com/attachments/545684759276421120/765064127793725450/bookmark.png') .setDescription(text) - .setFooter(getString(locale, "DirectoryBot", "expirationWarning").addVariables({ "time": millisecondsToHours(locale, state.infoLifetime)}), receivedMessage.client.user.avatarURL()) + .setFooter(receivedMessage.guild.name + " • " + getString(locale, "DirectoryBot", "expirationWarning").addVariables({ "time": millisecondsToHours(locale, state.infoLifetime)}), receivedMessage.guild.iconURL()) .setTimestamp(); if (directories[receivedMessage.guild.id].platformsList[platform].roleName) { diff --git a/Commands/mydata.js b/Commands/mydata.js index 7cb9f3d..78faf61 100644 --- a/Commands/mydata.js +++ b/Commands/mydata.js @@ -1,18 +1,19 @@ const Command = require('./../Classes/Command.js'); const { getString } = require('./../Localizations/localization.js'); const { MessageEmbed } = require('discord.js'); -const { directories } = require('../helpers.js'); +const { directories, tipBuilder } = require('../helpers.js'); const patrons = require('./../patrons.json'); var command = new Command("mydata", false, false, false); command.execute = (receivedMessage, state, locale) => { // Sends the user all the information they've input into the bot + var tip = tipBuilder(locale); let embed = new MessageEmbed().setColor('6b81eb') - .setAuthor(receivedMessage.guild.name, receivedMessage.guild.iconURL()) + .setAuthor(tip.text, `https://cdn.discordapp.com/icons/353575133157392385/c78041f52e8d6af98fb16b8eb55b849a.png `, tip.url) .setTitle(getString(locale, command.module, "yourData")) .setThumbnail('https://cdn.discordapp.com/attachments/545684759276421120/765064823511318548/gift-of-knowledge.png') - .setFooter(getString(locale, "DirectoryBot", "footerText"), `https://cdn.discordapp.com/icons/353575133157392385/c78041f52e8d6af98fb16b8eb55b849a.png `) + .setFooter(receivedMessage.guild.name, receivedMessage.guild.iconURL()) .setTimestamp(); let text = ''; let dictionary = directories[receivedMessage.guild.id].userDictionary[receivedMessage.author.id]; diff --git a/Commands/setlocale.js b/Commands/setlocale.js index f913d80..6348712 100644 --- a/Commands/setlocale.js +++ b/Commands/setlocale.js @@ -1,17 +1,18 @@ const Command = require('./../Classes/Command.js'); const { MessageEmbed } = require('discord.js'); const { getString, supportedLocales } = require('./../Localizations/localization.js'); -const { guildLocales } = require('./../helpers.js'); +const { guildLocales, tipBuilder } = require('./../helpers.js'); var command = new Command("setlocale", true, false, false); // Overload help command to add supported locales to field on execute command.help = (avatarURL, guildID, locale, guildName, module) => { - let embed = new MessageEmbed().setAuthor("Imaginary Horizons Productions", `https://cdn.discordapp.com/icons/353575133157392385/c78041f52e8d6af98fb16b8eb55b849a.png `, `https://discord.gg/FJ8JGq2`) + var tip = tipBuilder(locale); + let embed = new MessageEmbed().setAuthor(tip.text, avatarURL, tip.url) .setTitle(getString(locale, "DirectoryBot", "directoryBotCommand") + getString(locale, command.module, "names").join(', ')) .setThumbnail('https://cdn.discordapp.com/attachments/545684759276421120/765061579619565588/magnifying-glass.png') .setDescription(getString(locale, command.module, "description")) - .setFooter(getString(locale, "DirectoryBot", "footerText"), avatarURL); + .setFooter(getString(locale, "DirectoryBot", "footerText"), `https://cdn.discordapp.com/icons/353575133157392385/c78041f52e8d6af98fb16b8eb55b849a.png `); let headers = getString(locale, command.module, "headers"); let texts = getString(locale, command.module, "texts"); diff --git a/Commands/support.js b/Commands/support.js deleted file mode 100644 index ad90bfe..0000000 --- a/Commands/support.js +++ /dev/null @@ -1,33 +0,0 @@ -const Command = require('./../Classes/Command.js'); -const { getString } = require('./../Localizations/localization.js'); -const { MessageEmbed } = require('discord.js'); - -var command = new Command("support", false, false, true); - -// Overwrite detailed help description with executing the command -command.help = (avatarURL, guildID, locale, guildName, module) => { - return supportBuilder(avatarURL, locale); -} - -command.execute = (receivedMessage, state, locale) => { - // Lists ways users can support development - receivedMessage.author.send(supportBuilder(receivedMessage.client.user.displayAvatarURL(), locale)) - .catch(console.error); -} - -module.exports = command; - -function supportBuilder(footerURL, locale) { - return new MessageEmbed().setColor('6b81eb') - .setAuthor("Imaginary Horizons Productions", `https://cdn.discordapp.com/icons/353575133157392385/c78041f52e8d6af98fb16b8eb55b849a.png `, `https://discord.gg/FJ8JGq2`) - .setTitle(getString(locale, command.module, "supportingDirectoryBot")) - .setThumbnail(`https://cdn.discordapp.com/attachments/545684759276421120/734202424960745545/love-mystery.png`) - .setDescription(getString(locale, command.module, "embedDescription")) - .addField(getString(locale, command.module, "vote"), getString(locale, command.module, "voteText")) - .addField(getString(locale, command.module, "refer"), getString(locale, command.module, "referText")) - .addField(getString(locale, command.module, "contribute"), getString(locale, command.module, "contributeText")) - .addField(getString(locale, command.module, "social"), getString(locale, command.module, "socialText")) - .addField(getString(locale, command.module, "patron"), getString(locale, command.module, "patronText")) - .setFooter(getString(locale, command.module, "thanks"), footerURL) - .setTimestamp(); -} diff --git a/Localizations/de.json b/Localizations/de.json index 648b770..acbf1ad 100644 --- a/Localizations/de.json +++ b/Localizations/de.json @@ -17,6 +17,13 @@ "commandProperties": "", "propertiesText": "" }, + "tips": { + "vote": "", + "refer": "", + "contribute": "", + "social": "", + "patron": "" + }, "platformPossessivePronoun": { "token": "Possessivpronomen", "term": "Einstellung", @@ -334,26 +341,6 @@ "errorBadUser": "", "errorNoPlatform": "" }, - "support": { - "names": [], - "summary": "", - "description": "", - "headers": [], - "texts": [], - "supportingDirectoryBot": "", - "embedDescription": "", - "vote": "", - "voteText": "", - "refer": "", - "referText": "", - "contribute": "", - "contributeText": "", - "social": "", - "socialText": "", - "patron": "", - "patronText": "", - "thanks": "" - }, "tell": { "names": [], "summary": "", diff --git a/Localizations/en-US.json b/Localizations/en-US.json index 7c85948..c28f729 100644 --- a/Localizations/en-US.json +++ b/Localizations/en-US.json @@ -1,6 +1,6 @@ { "DirectoryBot": { - "footerText": "Support development with \"@DirectoryBot support\"", + "footerText": "Imaginary Horizons Productions", "errorBadCommand": "**${commandName}** isn't a command. Please check for typos or use ${botNickname}` help`.", "errorNotManager": "You need bot management permission (a role above DirectoryBot) to use the **${alias}** command.", "errorTooManyCommands": "To prevent excessive messaging, users are unable to enter more than ${commandLimit} commands in ${duration}. You can use ${botNickname}` lookup (platform)` to look up everyone's information for the given platform at once.", @@ -18,6 +18,13 @@ "commandProperties": "Command Properties", "propertiesText": "Premium: ${premium}\nUsable by Non-Managers: ${manager}\nUsable in Private Messages: ${dmCommand}" }, + "tips": { + "vote": "Click here to vote for DirectoryBot on top.gg!", + "refer": "Click here to get the DirectoryBot invite link!", + "contribute": "Click here to contribute to the DirectoryBot GitHub!", + "social": "Use the #ImaginaryHorizonsProductions hashtag!", + "patron": "Click here to go to Imaginary Horizons Productions Patreon!" + }, "platformPossessivePronoun": { "token": "PossessivePronoun", "term": "setting", @@ -334,26 +341,6 @@ "errorBadUser": "That person isn't a member of ${server}.", "errorNoPlatform": "Your `shoutout` command could not be completed. ${server} does not seem to have a \"stream\" platform." }, - "support": { - "names": [ "Support" ], - "summary": "Lists the ways to support development of DirectoryBot", - "description": "This command lists easy ways to support DirectoryBot development. Using `help` on this command uses the command.", - "headers": [ "Usage" ], - "texts": [ "`@DirectoryBot support`" ], - "supportingDirectoryBot": "Supporting DirectoryBot", - "embedDescription": "Thank you for using DirectoryBot! Here are some ways to support development:", - "vote": "Vote for us on top.gg", - "voteText": "top.gg is a Discord bot listing and distrabution service. Voting for DirectoryBot causes it to appear earlier in searches. [DirectoryBot's Page](https://top.gg/bot/585336216262803456)", - "refer": "Refer a friend", - "referText": "Got a friend interested in adding DirectoryBot to their server? Pass them [this link](https://discord.com/oauth2/authorize?client_id=585336216262803456&permissions=268446720&scope=bot)!", - "contribute": "Contribute code or localization support", - "contributeText": "Check out our [GitHub](https://github.com/Imaginary-Horizons-Productions/DirectoryBot) and tackle some issues!", - "social": "Create some social media buzz", - "socialText": "Use the #ImaginaryHorizonsProductions hashtag!", - "patron": "Become a Patron", - "patronText": "Chip in for server costs at the [Imaginary Horizons Productions Patreon](https://www.patreon.com/imaginaryhorizonsproductions)!", - "thanks": "Thanks in advanced!" - }, "tell": { "names": [ "Tell", "Send" ], "summary": "Have DirectoryBot send someone your information", diff --git a/Localizations/fr.json b/Localizations/fr.json index 0f6a099..b0deb22 100644 --- a/Localizations/fr.json +++ b/Localizations/fr.json @@ -1,6 +1,6 @@ { "DirectoryBot": { - "footerText": " Soutenir le développement avec \"@DirectoryBot support\"", + "footerText": "", "errorBadCommand": "**${commandName}$$ n'est pas une commande. Veuillez vérifier les fautes de frappe ou utiliser $[botNickname}` help`", "errorNotManager": "", "errorTooManyCommands": "", @@ -18,6 +18,13 @@ "propertiesText": "" }, + "tips": { + "vote": "", + "refer": "", + "contribute": "", + "social": "", + "patron": "" + }, "platformPossessivePronoun": { "token": "", "term": "", @@ -335,26 +342,6 @@ "errorBadUser": "", "errorNoPlatform": "" }, - "support": { - "names": [], - "summary": "", - "description": "", - "headers": [], - "texts": [], - "supportingDirectoryBot": "", - "embedDescription": "", - "vote": "", - "voteText": "", - "refer": "", - "referText": "", - "contribute": "", - "contributeText": "", - "social": "", - "socialText": "", - "patron": "", - "patronText": "", - "thanks": "" - }, "tell": { "names": [], "summary": "", diff --git a/Templates/localization_template.json b/Templates/localization_template.json index 37c21fe..1edcb33 100644 --- a/Templates/localization_template.json +++ b/Templates/localization_template.json @@ -17,6 +17,13 @@ "commandProperties": "", "propertiesText": "" }, + "tips": { + "vote": "", + "refer": "", + "contribute": "", + "social": "", + "patron": "" + }, "platformPossessivePronoun": { "token": "", "term": "", @@ -333,26 +340,6 @@ "errorBadUser": "", "errorNoPlatform": "" }, - "support": { - "names": [], - "summary": "", - "description": "", - "headers": [], - "texts": [], - "supportingDirectoryBot": "", - "embedDescription": "", - "vote": "", - "voteText": "", - "refer": "", - "referText": "", - "contribute": "", - "contributeText": "", - "social": "", - "socialText": "", - "patron": "", - "patronText": "", - "thanks": "" - }, "tell": { "names": [], "summary": "", diff --git a/helpers.js b/helpers.js index 3dc6ca8..6f04697 100644 --- a/helpers.js +++ b/helpers.js @@ -34,6 +34,31 @@ exports.millisecondsToHours = function (locale, milliseconds, showMinutes = fals return text; } +exports.tipBuilder = function (locale) { + var tipIDs = ["vote", "refer", "contribute", "social", "patron"]; + var tip = {}; + var tipID = tipIDs[Math.floor(Math.random() * tipIDs.length)]; + tip.text = getString(locale, "tips", tipID); + switch (tipID) { + case "vote": + tip.url = "https://top.gg/bot/585336216262803456"; + break; + case "refer": + tip.url = "https://discord.com/oauth2/authorize?client_id=585336216262803456&permissions=268446720&scope=bot"; + break; + case "contribute": + tip.url = "https://github.com/Imaginary-Horizons-Productions/DirectoryBot"; + break; + case "social": + tip.url = ""; + break; + case "patron": + tip.url = "https://www.patreon.com/imaginaryhorizonsproductions"; + break; + } + return tip; +} + exports.platformsBuilder = function (guildName, platformsList, locale) { let platformTexts = []; for (const platform of Object.keys(platformsList)) { @@ -58,12 +83,13 @@ exports.versionBuilder = function (avatarURL = '') { var knownIssuesStart = knownIssuesStartRegEx.exec(data).index; var knownIssuesEnd = dividerRegEx.exec(data).index; + var tip = tipBuilder("en-US"); var embed = new MessageEmbed().setColor('6b81eb') - .setAuthor(`Imaginary Horizons Productions`, `https://cdn.discordapp.com/icons/353575133157392385/c78041f52e8d6af98fb16b8eb55b849a.png `, `https://github.com/Imaginary-Horizons-Productions `) + .setAuthor(tip.text, avatarURL, tip.url) .setTitle(data.slice(titleStart + 5, changesStartRegEx.lastIndex)) .setURL(`https://discord.gg/FJ8JGq2`) .setThumbnail('https://cdn.discordapp.com/attachments/545684759276421120/734099622846398565/newspaper.png') - .setFooter(getString("en-US", "DirectoryBot", "footerText"), avatarURL) + .setFooter(getString("en-US", "DirectoryBot", "footerText"), `https://cdn.discordapp.com/icons/353575133157392385/c78041f52e8d6af98fb16b8eb55b849a.png `) .setTimestamp(); if (knownIssuesStart < knownIssuesEnd) { From cf1e392510da5b5e6010873fcd64e41e8f9f4e5c Mon Sep 17 00:00:00 2001 From: Nathaniel Tseng Date: Sun, 8 Aug 2021 12:43:25 -0700 Subject: [PATCH 4/5] 2.2 Improvement - updated about embed --- Commands/about.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Commands/about.js b/Commands/about.js index a6e8c22..4b02e56 100644 --- a/Commands/about.js +++ b/Commands/about.js @@ -25,7 +25,7 @@ function creditsBuilder(footerURL, locale) { .setTitle(getString(locale, command.module, "creditsTitle")) .setThumbnail('https://cdn.discordapp.com/attachments/545684759276421120/734097014974971924/theater-curtains.png') .setURL(`https://github.com/Imaginary-Horizons-Productions/DirectoryBot `) - .addField(getString(locale, command.module, "designAndEngineering"), `Nathaniel Tseng ( <@106122478715150336> | [Twitter](https://twitter.com/Archainis) )`) + .addField(getString(locale, command.module, "designAndEngineering"), `Nathaniel Tseng ( <@106122478715150336> | [Twitter](https://twitter.com/Arcane_ish) )`) .addField(getString(locale, command.module, "engineering"), `Lucas Ensign ( <@112785244733628416> | [Twitter](https://twitter.com/SillySalamndr) )`) .addField(getString(locale, command.module, "art"), `Angela Lee ( [Website](https://www.angelasylee.com/) )`) .addField(getString(locale, command.module, "localization"), `Mnemmy (fr), towoko (de), Lille (de)`) From 543f33f69b843f8af4ddd0a154e29f0c836e2976 Mon Sep 17 00:00:00 2001 From: Nathaniel Tseng Date: Sun, 8 Aug 2021 12:43:47 -0700 Subject: [PATCH 5/5] 2.2 Improvement - updated about embed (again) --- Commands/about.js | 1 - 1 file changed, 1 deletion(-) diff --git a/Commands/about.js b/Commands/about.js index 4b02e56..b21b22a 100644 --- a/Commands/about.js +++ b/Commands/about.js @@ -31,7 +31,6 @@ function creditsBuilder(footerURL, locale) { .addField(getString(locale, command.module, "localization"), `Mnemmy (fr), towoko (de), Lille (de)`) .addField(`Embed Thumbnails`, `[game-icons.net](https://game-icons.net/)`) .addField(`\u200B`, getString(locale, command.module, "patronsDescription")) - .addField(getString(locale, command.module, "archivistTier"), "Victor Huang", false) .addField(getString(locale, command.module, "cartographerTier"), `Ralph Beish`, false) .addField(getString(locale, command.module, "explorerTier"), `Eric Hu`, false) .setFooter(getString(locale, "DirectoryBot", "footerText"), `https://cdn.discordapp.com/icons/353575133157392385/c78041f52e8d6af98fb16b8eb55b849a.png `)