diff --git a/bot/commands/Bot/help.js b/bot/commands/Bot/help.js index 2644ba0..b7b8656 100644 --- a/bot/commands/Bot/help.js +++ b/bot/commands/Bot/help.js @@ -90,6 +90,6 @@ module.exports = class { return message.channel.createMessage({ embed: embed }); } - return message.channel.createMessage(`${client.emojis.userError} ${cmd} doesn't appear to be a command, alias, or category. Are you sure you spelt it right?`); + return message.channel.createMessage(`${client.config.emojis.userError} ${cmd} doesn't appear to be a command, alias, or category. Are you sure you spelt it right?`); } }; \ No newline at end of file diff --git a/bot/commands/Configuration/blocklist.js b/bot/commands/Configuration/blocklist.js index f4c1db9..acfb9ee 100644 --- a/bot/commands/Configuration/blocklist.js +++ b/bot/commands/Configuration/blocklist.js @@ -39,11 +39,11 @@ module.exports = class { action = action.toLowerCase(); if (action !== 'add' & action !== 'remove') { - return message.channel.createMessage(`${client.emojis.userError} You didn't specify a valid action. Usage: \`${this.help.usage}\``); + return message.channel.createMessage(`${client.config.emojis.userError} You didn't specify a valid action. Usage: \`${this.help.usage}\``); } if (!user) return message.channel.createMessage( - `${client.emojis.userError} You didn't specify a user. Usage: \`${message.prefix + this.help.usage}\`` + `${client.config.emojis.userError} You didn't specify a user. Usage: \`${message.prefix + this.help.usage}\`` ); let member; @@ -57,11 +57,11 @@ module.exports = class { member = await message.channel.guild.searchMembers(user.join(' '), 2); if (member.length === 0) return message.channel.createMessage( - `${client.emojis.userError} No users found. Check for mispellings, or ping the user instead.` + `${client.config.emojis.userError} No users found. Check for mispellings, or ping the user instead.` ); if (member.length > 1) return message.channel.createMessage( - `${client.emojis.userError} Found more than one user, try refining your search or pinging the user instead.` + `${client.config.emojis.userError} Found more than one user, try refining your search or pinging the user instead.` ); member = member[0]; @@ -72,24 +72,24 @@ module.exports = class { if (action === 'add') { if (member.id === message.channel.guild.ownerID) return message.channel.createMessage( - `${client.emojis.userError} You can't block the owner, silly!` + `${client.config.emojis.userError} You can't block the owner, silly!` ); if (client.functions.highestRole(member).position >= client.functions.highestRole(message.member).position && message.member.id !== message.channel.guild.ownerID) { - return message.channel.createMessage(`${client.emojis.userError} This user has a higher role than you, you can't add them to the blocklist!`); + return message.channel.createMessage(`${client.config.emojis.userError} This user has a higher role than you, you can't add them to the blocklist!`); } if (blocklist.includes(member.id)) return message.channel.createMessage( - `${client.emojis.userError} This user is already on the blocklist, you can't add them twice!` + `${client.config.emojis.userError} This user is already on the blocklist, you can't add them twice!` ); blocklist.push(member.id); client.db.updateGuild(message.channel.guild.id, 'blocklist', blocklist).then(() => { - message.channel.createMessage(`${client.emojis.success} Added \`${member.username}#${member.discriminator}\` to the blocklist.`); + message.channel.createMessage(`${client.config.emojis.success} Added \`${member.username}#${member.discriminator}\` to the blocklist.`); }).catch(error => { client.logger.error('GUILD_UPDATE_ERROR', error); - message.channel.createMessage(`${client.emojis.botError} An error occured while adding this user to the blocklist, please try again! **Error:** ${error}`); + message.channel.createMessage(`${client.config.emojis.botError} An error occured while adding this user to the blocklist, please try again! **Error:** ${error}`); }) ; return; @@ -97,20 +97,20 @@ module.exports = class { if (action === 'remove') { if (client.functions.highestRole(member).position >= client.functions.highestRole(message.member).position && message.member.id !== message.channel.guild.ownerID) { - return message.channel.createMessage(`${client.emojis.userError} This user has a higher role than you, you can't remove them to the blocklist!`); + return message.channel.createMessage(`${client.config.emojis.userError} This user has a higher role than you, you can't remove them to the blocklist!`); } if (!blocklist.includes(member.id)) return message.channel.createMessage( - `${client.emojis.userError} This user isn't on the blocklist.` + `${client.config.emojis.userError} This user isn't on the blocklist.` ); blocklist.remove(member.id); client.db.updateGuild(message.channel.guild.id, 'blocklist', blocklist).then(() => { - message.channel.createMessage(`${client.emojis.success} Removed \`${member.username}#${member.discriminator}\` from the blocklist.`); + message.channel.createMessage(`${client.config.emojis.success} Removed \`${member.username}#${member.discriminator}\` from the blocklist.`); }).catch(error => { client.logger.error('GUILD_UPDATE_ERROR', error); - message.channel.createMessage(`${client.emojis.botError} An error occured while removing this user from the blocklist, please try again! **Error:** ${error}`); + message.channel.createMessage(`${client.config.emojis.botError} An error occured while removing this user from the blocklist, please try again! **Error:** ${error}`); }) ; return; diff --git a/bot/commands/Configuration/disable.js b/bot/commands/Configuration/disable.js index 591d2a5..cbcf659 100644 --- a/bot/commands/Configuration/disable.js +++ b/bot/commands/Configuration/disable.js @@ -27,7 +27,7 @@ module.exports = class { } if (!args[1]) return message.channel.createMessage( - `${client.emojis.userError} You didn't specify what command/category to disable. Usage: \`${this.help.usage}\`` + `${client.config.emojis.userError} You didn't specify what command/category to disable. Usage: \`${this.help.usage}\`` ); if (args[0].toLowerCase() === 'command' || args[0].toLowerCase() === 'cmd') { @@ -42,17 +42,17 @@ module.exports = class { } if (!command) return message.channel.createMessage( - `${client.emojis.userError} ${args[1]} isn't a command or an alias, are you sure you spelt it correctly?` + `${client.config.emojis.userError} ${args[1]} isn't a command or an alias, are you sure you spelt it correctly?` ); if (essential.commands.includes(command.name) || essential.categories.includes(command.category)) { return message.channel.createMessage( - `${client.emojis.userError} This command is essential and cannot be disabled. Sorry!` + `${client.config.emojis.userError} This command is essential and cannot be disabled. Sorry!` ); } if (disabled.includes(command.name)) return message.channel.createMessage( - `${client.emojis.userError} This command is already disabled.` + `${client.config.emojis.userError} This command is already disabled.` ); disabled.push(command.name); @@ -60,7 +60,7 @@ module.exports = class { await client.db.updateGuild(message.channel.guild.id, 'disabledcommands', disabled); return message.channel.createMessage( - `${client.emojis.success} Added **${args[1]}** to the list of disabled commands for this server.` + `${client.config.emojis.success} Added **${args[1]}** to the list of disabled commands for this server.` ); } @@ -76,11 +76,11 @@ module.exports = class { } if (!command) return message.channel.createMessage( - `${client.emojis.userError} ${args[1]} isn't a category, are you sure you spelt it correctly?` + `${client.config.emojis.userError} ${args[1]} isn't a category, are you sure you spelt it correctly?` ); if (!disabled.includes(command.name)) return message.channel.createMessage( - `${client.emojis.userError} This category isn't disabled.` + `${client.config.emojis.userError} This category isn't disabled.` ); disabled.remove(command.name); @@ -88,7 +88,7 @@ module.exports = class { await client.db.updateGuild(message.channel.guild.id, 'disabledcommands', disabled); return message.channel.createMessage( - `${client.emojis.success} Added **${args[1]}** to the list of disabled category for this server!` + `${client.config.emojis.success} Added **${args[1]}** to the list of disabled category for this server!` ); } } diff --git a/bot/commands/Configuration/userprefix.js b/bot/commands/Configuration/userprefix.js index ebde73a..ce46817 100644 --- a/bot/commands/Configuration/userprefix.js +++ b/bot/commands/Configuration/userprefix.js @@ -26,7 +26,7 @@ module.exports = class { await client.db.updateUser(message.author.id, 'prefix', args[0]); message.channel.createMessage( - `${client.emojis.success} Your personal prefix has been set to: \`${args[0]}\`` + `${client.config.emojis.success} Your personal prefix has been set to: \`${args[0]}\`` ); } }; \ No newline at end of file diff --git a/bot/commands/Fun/garfield.js b/bot/commands/Fun/garfield.js index 6f78a2f..2e63116 100644 --- a/bot/commands/Fun/garfield.js +++ b/bot/commands/Fun/garfield.js @@ -33,7 +33,7 @@ module.exports = class { message.channel.createMessage({ embed: embed }); }) .catch(err => { - message.channel.createMessage(`${client.emojis.botError} An error has occurred: ${err}`); + message.channel.createMessage(`${client.config.emojis.botError} An error has occurred: ${err}`); }); } }; \ No newline at end of file diff --git a/bot/commands/Fun/inspire.js b/bot/commands/Fun/inspire.js index cd7dd5f..fe7dbd3 100644 --- a/bot/commands/Fun/inspire.js +++ b/bot/commands/Fun/inspire.js @@ -25,7 +25,7 @@ module.exports = class { .then(res => res.text()) .then(body => message.channel.createMessage(body)); } catch (err) { - message.channel.createMessage(`${client.emojis.botError} An error has occurred: ${err}`); + message.channel.createMessage(`${client.config.emojis.botError} An error has occurred: ${err}`); } } }; \ No newline at end of file diff --git a/bot/commands/Pokemon/ability.js b/bot/commands/Pokemon/ability.js index dd0ad0c..743ae5c 100644 --- a/bot/commands/Pokemon/ability.js +++ b/bot/commands/Pokemon/ability.js @@ -20,7 +20,7 @@ module.exports = class { run (client, message, args, data) { //eslint-disable-line no-unused-vars if (!args[0]) return message.channel.createMessage( - `${client.emojis.userError} You didn't give me an ability to look up!` + `${client.config.emojis.userError} You didn't give me an ability to look up!` ); message.channel.sendTyping(); @@ -53,7 +53,7 @@ module.exports = class { json.errors.forEach(error => { if (error.message.startsWith('Failed to get data for ability')) { message.channel.createMessage( - `${client.emojis.userError} I couldn't find any abilities with names similar to ${query}. Check your spelling, maybe?` + `${client.config.emojis.userError} I couldn't find any abilities with names similar to ${query}. Check your spelling, maybe?` ); } else { client.logger.error('POKEMON_API_ERROR', error.message); diff --git a/bot/commands/Pokemon/effective.js b/bot/commands/Pokemon/effective.js index dc5f5d3..af9ada4 100644 --- a/bot/commands/Pokemon/effective.js +++ b/bot/commands/Pokemon/effective.js @@ -21,7 +21,7 @@ module.exports = class { async run (client, message, args, data) { //eslint-disable-line no-unused-vars if (!args[0]) return message.channel.createMessage( - `${client.emojis.userError} You didn't give me a pokemon or type combination to look up! Usage: \`${message.prefix + this.name + ' ' + this.help.arguments}\`` + `${client.config.emojis.userError} You didn't give me a pokemon or type combination to look up! Usage: \`${message.prefix + this.name + ' ' + this.help.arguments}\`` ); message.channel.sendTyping(); @@ -48,7 +48,7 @@ module.exports = class { json.errors.forEach(error => { if (error.message.startsWith('No Pokémon found')) { message.channel.createMessage( - `${client.emojis.userError} I couldn't find any Pokemon with names similar to ${args.join(' ').toLowerCase()}. Check your spelling, maybe?` + `${client.config.emojis.userError} I couldn't find any Pokemon with names similar to ${args.join(' ').toLowerCase()}. Check your spelling, maybe?` ); } else { client.logger.error('MATCHUP_API_ERROR', error.message); @@ -82,7 +82,7 @@ module.exports = class { json.errors.forEach(error => { if (error.message.includes('does not exist in "Types')) { message.channel.createMessage( - `${client.emojis.userError} One or more of the types you gave me are invalid. Check your spelling, maybe?` + `${client.config.emojis.userError} One or more of the types you gave me are invalid. Check your spelling, maybe?` ); } else { client.logger.error('MATCHUP_FETCH_ERROR', error.message); diff --git a/bot/commands/Pokemon/item.js b/bot/commands/Pokemon/item.js index 9ed03da..e30a45f 100644 --- a/bot/commands/Pokemon/item.js +++ b/bot/commands/Pokemon/item.js @@ -20,7 +20,7 @@ module.exports = class { run (client, message, args, data) { //eslint-disable-line no-unused-vars if (!args[0]) return message.channel.createMessage( - `${client.emojis.userError} You didn't give me an item to look up!` + `${client.config.emojis.userError} You didn't give me an item to look up!` ); message.channel.sendTyping(); @@ -54,7 +54,7 @@ module.exports = class { json.errors.forEach(error => { if (error.message.startsWith('Failed to get data for item')) { message.channel.createMessage( - `${client.emojis.userError} I couldn't find any items with names similar to ${query}. Check your spelling, maybe?` + `${client.config.emojis.userError} I couldn't find any items with names similar to ${query}. Check your spelling, maybe?` ); } else { client.logger.error('POKEMON_API_ERROR', error.message); diff --git a/bot/commands/Pokemon/move.js b/bot/commands/Pokemon/move.js index cf6fd7a..6a82f6d 100644 --- a/bot/commands/Pokemon/move.js +++ b/bot/commands/Pokemon/move.js @@ -21,7 +21,7 @@ module.exports = class { run (client, message, args, data) { //eslint-disable-line no-unused-vars if (!args[0]) return message.channel.createMessage( - `${client.emojis.userError} You didn't give me a pokemon move to look up!` + `${client.config.emojis.userError} You didn't give me a pokemon move to look up!` ); message.channel.sendTyping(); @@ -66,7 +66,7 @@ module.exports = class { json.errors.forEach(error => { if (error.message.startsWith('Failed to get data for move')) { message.channel.createMessage( - `${client.emojis.userError} I couldn't find any moves with names similar to ${query}. Check your spelling, maybe?` + `${client.config.emojis.userError} I couldn't find any moves with names similar to ${query}. Check your spelling, maybe?` ); } else { client.logger.error('POKEMON_API_ERROR', error.message); diff --git a/bot/commands/Pokemon/pokemon.js b/bot/commands/Pokemon/pokemon.js index a88f3c8..19bf8c3 100644 --- a/bot/commands/Pokemon/pokemon.js +++ b/bot/commands/Pokemon/pokemon.js @@ -21,7 +21,7 @@ module.exports = class { async run (client, message, args, data) { //eslint-disable-line no-unused-vars if (!args[0]) return message.channel.createMessage( - `${client.emojis.userError} You didn't give me a pokemon to look up!` + `${client.config.emojis.userError} You didn't give me a pokemon to look up!` ); message.channel.sendTyping(); @@ -69,7 +69,7 @@ module.exports = class { json.errors.forEach(error => { if (error.message.startsWith('No Pokémon found')) { message.channel.createMessage( - `${client.emojis.userError} I couldn't find any Pokemon with names similar to ${query}. Check your spelling, maybe?` + `${client.config.emojis.userError} I couldn't find any Pokemon with names similar to ${query}. Check your spelling, maybe?` ); } else { client.logger.error('POKEMON_API_ERROR', error.message); diff --git a/bot/commands/Splatoon/salmonrun.js b/bot/commands/Splatoon/salmonrun.js index 4a21612..243736f 100644 --- a/bot/commands/Splatoon/salmonrun.js +++ b/bot/commands/Splatoon/salmonrun.js @@ -68,7 +68,7 @@ module.exports = class { }); }) .catch(err => { - message.channel.createMessage(`${client.emojis.botError} An error has occurred: ${err}`); + message.channel.createMessage(`${client.config.emojis.botError} An error has occurred: ${err}`); }); } }; \ No newline at end of file diff --git a/bot/commands/Splatoon/splatnet.js b/bot/commands/Splatoon/splatnet.js index ef1d5a8..ef95cee 100644 --- a/bot/commands/Splatoon/splatnet.js +++ b/bot/commands/Splatoon/splatnet.js @@ -44,7 +44,7 @@ module.exports = class { createPaginationEmbed(message, embeds); }) .catch(err => { - message.channel.createMessage(`${client.emojis.botError} An error has occurred: ${err}`); + message.channel.createMessage(`${client.config.emojis.botError} An error has occurred: ${err}`); }); } }; \ No newline at end of file diff --git a/bot/commands/Splatoon/splatoonmaps.js b/bot/commands/Splatoon/splatoonmaps.js index 3816464..3633f43 100644 --- a/bot/commands/Splatoon/splatoonmaps.js +++ b/bot/commands/Splatoon/splatoonmaps.js @@ -50,7 +50,7 @@ module.exports = class { createPaginationEmbed(message, embeds); }) .catch(err => { - message.channel.createMessage(`${client.emojis.botError} An error has occurred: ${err}`); + message.channel.createMessage(`${client.config.emojis.botError} An error has occurred: ${err}`); }); } }; \ No newline at end of file diff --git a/bot/commands/Utility/avatar.js b/bot/commands/Utility/avatar.js index 48bf31e..62f4ddf 100644 --- a/bot/commands/Utility/avatar.js +++ b/bot/commands/Utility/avatar.js @@ -30,11 +30,11 @@ module.exports = class { member = await message.channel.guild.searchMembers(args.join(' '), 2); if (member.length === 0) return message.channel.createMessage( - `${client.emojis.userError} No users found. Check for mispellings, or ping the user instead.` + `${client.config.emojis.userError} No users found. Check for mispellings, or ping the user instead.` ); if (member.length > 1) return message.channel.createMessage( - `${client.emojis.userError} Found more than one user, try refining your search or pinging the user instead.` + `${client.config.emojis.userError} Found more than one user, try refining your search or pinging the user instead.` ); member = member[0]; diff --git a/bot/commands/Utility/userinfo.js b/bot/commands/Utility/userinfo.js index 5e60fb0..b09119e 100644 --- a/bot/commands/Utility/userinfo.js +++ b/bot/commands/Utility/userinfo.js @@ -32,11 +32,11 @@ module.exports = class { member = await message.channel.guild.searchMembers(args.join(' '), 2); if (member.length === 0) return message.channel.createMessage( - `${client.emojis.userError} No users found. Check for mispellings, or ping the user instead.` + `${client.config.emojis.userError} No users found. Check for mispellings, or ping the user instead.` ); if (member.length > 1) return message.channel.createMessage( - `${client.emojis.userError} Found more than one user, try refining your search or pinging the user instead.` + `${client.config.emojis.userError} Found more than one user, try refining your search or pinging the user instead.` ); member = member[0]; diff --git a/bot/commands/Utility/weather.js b/bot/commands/Utility/weather.js index 6048ea0..02469ba 100644 --- a/bot/commands/Utility/weather.js +++ b/bot/commands/Utility/weather.js @@ -74,13 +74,13 @@ module.exports = class { return message.channel.createMessage({ embed:embed }); } else { if (json.message && json.message === 'city not found') { - return message.channel.createMessage(`${client.emojis.userError} You provided an invalid city name. Maybe check your spelling?`); + return message.channel.createMessage(`${client.config.emojis.userError} You provided an invalid city name. Maybe check your spelling?`); } - return message.channel.createMessage(`${client.emojis.botError} API error occured: \`code ${json.cod}: ${json.message}\``); + return message.channel.createMessage(`${client.config.emojis.botError} API error occured: \`code ${json.cod}: ${json.message}\``); } }) .catch(err => { - return message.channel.createMessage(`${client.emojis.botError} An error has occured: \`${err.stack}\``); + return message.channel.createMessage(`${client.config.emojis.botError} An error has occured: \`${err.stack}\``); }); } }; \ No newline at end of file diff --git a/bot/event_modules/ready/activity.js b/bot/event_modules/ready/activity.js index 09ca137..ea72c7a 100644 --- a/bot/event_modules/ready/activity.js +++ b/bot/event_modules/ready/activity.js @@ -7,6 +7,6 @@ module.exports = class { async run (client) { const activity = activities.random(); - client.editStatus('online', { name: `${activity.message} | v${client.version}`, type: activity.type}); + client.user.setPresence({ activities: [{ name: `${activity.message} | v${client.version}` }], status: 'online' }); } }; \ No newline at end of file diff --git a/bot/util/handlers/messageHandler.js b/bot/util/handlers/messageHandler.js index 95cc493..63056cb 100644 --- a/bot/util/handlers/messageHandler.js +++ b/bot/util/handlers/messageHandler.js @@ -62,33 +62,33 @@ class MessageHandler { // Both of these blocks check if the command is disabled/in a disabled category if (data.guild.disabledcommands.includes(command.name)) return message.channel.createMessage( - this.client.emojis.permError + ' This command has been disabled by a server administrator.' + this.client.config.emojis.permError + ' This command has been disabled by a server administrator.' ); if (data.guild.disabledcategories.includes(command.category)) return message.channel.createMessage( - this.client.emojis.permError + ' The category this command is apart of has been disabled by a server administrator.' + this.client.config.emojis.permError + ' The category this command is apart of has been disabled by a server administrator.' ); // Both of these blocks check the permissions of the user, and reply with missing perms if any are found const missingUserPerms = this.client.functions.checkPermissions(message.channel, message.author.id, command.userPerms); if (missingUserPerms) return message.channel.createMessage( - `${this.client.emojis.permError} You can't use this command because you lack these permissions: \`${missingUserPerms.join('`, `')}\`` + `${this.client.config.emojis.permError} You can't use this command because you lack these permissions: \`${missingUserPerms.join('`, `')}\`` ); const missingBotPerms = this.client.functions.checkPermissions(message.channel, this.client.user.id, command.botPerms); if (missingBotPerms) return message.channel.createMessage( - `${this.client.emojis.permError} I can't run this command because I lack these permissions: \`${missingBotPerms.join('`, `')}\`` + `${this.client.config.emojis.permError} I can't run this command because I lack these permissions: \`${missingBotPerms.join('`, `')}\`` ); // Return if the command is disabled globally if (command.enabled === false) return message.channel.createMessage( - this.client.emojis.permError + ' This command has been disabled by my developers.' + this.client.config.emojis.permError + ' This command has been disabled by my developers.' ); // Return if the command is restricted to developers (and the user is not a developer) if (command.devOnly === true && this.client.config.ownerIDs.includes(message.author.id) !== true) { return message.channel.createMessage( - `${this.client.emojis.permError} ${message.author.username} is not in the sudoers file. This incident will be reported.` + `${this.client.config.emojis.permError} ${message.author.username} is not in the sudoers file. This incident will be reported.` ); } @@ -99,7 +99,7 @@ class MessageHandler { const cooldown = command.cooldown / 1000; const timePassed = Math.floor((currentTime - timestamp) / 1000); return message.channel.createMessage( - `${this.client.emojis.wait} ${message.author.mention}, you need to wait ${cooldown - timePassed} seconds before using this command again.` + `${this.client.config.emojis.wait} ${message.author.mention}, you need to wait ${cooldown - timePassed} seconds before using this command again.` ); } else { this.client.cooldowns.get(command.name).set(message.author.id, new Date()); @@ -113,7 +113,7 @@ class MessageHandler { this.client.logger.command(`Ran ${command.name}`); } catch (error) { this.client.logger.error('COMMAND_EXECUTION_ERROR', `${command.name}: ${error}`); - message.channel.createMessage(`${this.client.emojis.botError} An error occured when I was trying to run this command. I've sent through the details of the error to my developers.`); + message.channel.createMessage(`${this.client.config.emojis.botError} An error occured when I was trying to run this command. I've sent through the details of the error to my developers.`); } } }