Skip to content
This repository was archived by the owner on Oct 24, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
/guildsList.txt
/encryptionKey.txt
versionData.json
patrons.json
6 changes: 4 additions & 2 deletions Classes/Command.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { MessageEmbed } = require('discord.js');
const { tipBuilder } = require('../helpers.js');
const { getString } = require('./../Localizations/localization.js');

module.exports = class Command {
Expand All @@ -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:",
Expand Down
2 changes: 1 addition & 1 deletion Commands/CommandsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down
9 changes: 5 additions & 4 deletions Commands/about.js
Original file line number Diff line number Diff line change
@@ -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);

Expand All @@ -18,20 +19,20 @@ 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 `)
.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)`)
.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, "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();
}
6 changes: 4 additions & 2 deletions Commands/datapolicy.js
Original file line number Diff line number Diff line change
@@ -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);

Expand All @@ -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();
}
6 changes: 4 additions & 2 deletions Commands/getstarted.js
Original file line number Diff line number Diff line change
@@ -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);

Expand All @@ -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) {
Expand Down
8 changes: 5 additions & 3 deletions Commands/help.js
Original file line number Diff line number Diff line change
@@ -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);

Expand Down Expand Up @@ -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) {
Expand Down
12 changes: 7 additions & 5 deletions Commands/lookup.js
Original file line number Diff line number Diff line change
@@ -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");
Expand Down Expand Up @@ -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) {
Expand Down
26 changes: 11 additions & 15 deletions Commands/mydata.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,37 @@
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];
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');
}

Expand Down
7 changes: 4 additions & 3 deletions Commands/setlocale.js
Original file line number Diff line number Diff line change
@@ -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");
Expand Down
33 changes: 0 additions & 33 deletions Commands/support.js

This file was deleted.

27 changes: 7 additions & 20 deletions Localizations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
"commandProperties": "",
"propertiesText": ""
},
"tips": {
"vote": "",
"refer": "",
"contribute": "",
"social": "",
"patron": ""
},
"platformPossessivePronoun": {
"token": "Possessivpronomen",
"term": "Einstellung",
Expand Down Expand Up @@ -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": "",
Expand Down
Loading