From e3762caf7b70b2255feb3c21e986b5b4f2a77174 Mon Sep 17 00:00:00 2001 From: Mennoplays Date: Mon, 15 Feb 2021 19:24:16 +0100 Subject: [PATCH 1/4] Updated fun category to v12 --- Ep_14/commands/fun/fortnite.js | 8 ++++---- Ep_14/commands/fun/love.js | 4 ++-- Ep_14/commands/fun/meme.js | 4 ++-- Ep_14/commands/fun/rps.js | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Ep_14/commands/fun/fortnite.js b/Ep_14/commands/fun/fortnite.js index d2a67ed..1cf2f25 100644 --- a/Ep_14/commands/fun/fortnite.js +++ b/Ep_14/commands/fun/fortnite.js @@ -1,4 +1,4 @@ -const { RichEmbed } = require("discord.js"); +const { MessageEmbed } = require("discord.js"); const { stripIndents } = require("common-tags"); const Client = require("fortnite"); @@ -15,7 +15,7 @@ module.exports = { if (args[0].toLowerCase() === "store") { const store = await ft.store(); - const embed = new RichEmbed() + const embed = new MessageEmbed() .setColor("#9d4dbb") .setFooter("Fortnite store", message.author.displayAvatarURL) .setTimestamp(); @@ -56,11 +56,11 @@ module.exports = { const duo = search.stats.duo; const squad = search.stats.squad; - const embed = new RichEmbed() + const embed = new MessageEmbed() .setTitle(`${search.username} (${search.platform})`) .setURL(search.url) .setColor("#9d4dbb") - .setFooter(`Fortnite stats`, message.author.displayAvatarURL) + .setFooter(`Fortnite stats`, message.author.displayAvatarURL()) .setTimestamp() .addField("Solo:", stripIndents`**- Wins:** ${solo.wins} **- KD:** ${solo.kd} diff --git a/Ep_14/commands/fun/love.js b/Ep_14/commands/fun/love.js index d981f72..13fda70 100644 --- a/Ep_14/commands/fun/love.js +++ b/Ep_14/commands/fun/love.js @@ -1,4 +1,4 @@ -const { RichEmbed } = require("discord.js"); +const { MessageEmbed } = require("discord.js"); const { getMember } = require("../../functions.js"); module.exports = { @@ -21,7 +21,7 @@ module.exports = { const loveIndex = Math.floor(love / 10); const loveLevel = "💖".repeat(loveIndex) + "💔".repeat(10 - loveIndex); - const embed = new RichEmbed() + const embed = new MessageEmbed() .setColor("#ffb6c1") .addField(`☁ **${person.displayName}** loves **${message.member.displayName}** this much:`, `💟 ${Math.floor(love)}%\n\n${loveLevel}`); diff --git a/Ep_14/commands/fun/meme.js b/Ep_14/commands/fun/meme.js index 01fde84..a4e0ed9 100644 --- a/Ep_14/commands/fun/meme.js +++ b/Ep_14/commands/fun/meme.js @@ -1,4 +1,4 @@ -const { RichEmbed } = require("discord.js"); +const { MessageEmbed } = require("discord.js"); const randomPuppy = require("random-puppy"); module.exports = { @@ -10,7 +10,7 @@ module.exports = { const random = subReddits[Math.floor(Math.random() * subReddits.length)]; const img = await randomPuppy(random); - const embed = new RichEmbed() + const embed = new MessageEmbed() .setColor("RANDOM") .setImage(img) .setTitle(`From /r/${random}`) diff --git a/Ep_14/commands/fun/rps.js b/Ep_14/commands/fun/rps.js index 77371dd..3395844 100644 --- a/Ep_14/commands/fun/rps.js +++ b/Ep_14/commands/fun/rps.js @@ -1,4 +1,4 @@ -const { RichEmbed } = require("discord.js"); +const { MessageEmbed } = require("discord.js"); const { promptMessage } = require("../../functions.js"); const chooseArr = ["🗻", "📰", "✂"]; @@ -9,9 +9,9 @@ module.exports = { description: "Rock Paper Scissors game. React to one of the emojis to play the game.", usage: "rps", run: async (client, message, args) => { - const embed = new RichEmbed() + const embed = new MessageEmbed() .setColor("#ffffff") - .setFooter(message.guild.me.displayName, client.user.displayAvatarURL) + .setFooter(message.guild.me.displayName, client.user.displayAvatarURL()) .setDescription("Add a reaction to one of these emojis to play the game!") .setTimestamp(); From c28c935ca5aeed9df58b005d820cc95d6ff0a009 Mon Sep 17 00:00:00 2001 From: Mennoplays Date: Mon, 15 Feb 2021 19:30:36 +0100 Subject: [PATCH 2/4] Updated info category to v12 --- Ep_14/commands/info/help.js | 6 +++--- Ep_14/commands/info/instagram.js | 4 ++-- Ep_14/commands/info/whois.js | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Ep_14/commands/info/help.js b/Ep_14/commands/info/help.js index 20e68f9..87c2a06 100644 --- a/Ep_14/commands/info/help.js +++ b/Ep_14/commands/info/help.js @@ -1,4 +1,4 @@ -const { RichEmbed } = require("discord.js"); +const { MessageEmbed } = require("discord.js"); const { stripIndents } = require("common-tags"); module.exports = { @@ -17,7 +17,7 @@ module.exports = { } function getAll(client, message) { - const embed = new RichEmbed() + const embed = new MessageEmbed() .setColor("RANDOM") const commands = (category) => { @@ -35,7 +35,7 @@ function getAll(client, message) { } function getCMD(client, message, input) { - const embed = new RichEmbed() + const embed = new MessageEmbed() const cmd = client.commands.get(input.toLowerCase()) || client.commands.get(client.aliases.get(input.toLowerCase())); diff --git a/Ep_14/commands/info/instagram.js b/Ep_14/commands/info/instagram.js index 29869f6..8a007d7 100644 --- a/Ep_14/commands/info/instagram.js +++ b/Ep_14/commands/info/instagram.js @@ -1,4 +1,4 @@ -const { RichEmbed } = require("discord.js"); +const { MessageEmbed } = require("discord.js"); const { stripIndents } = require("common-tags"); const fetch = require("node-fetch"); @@ -30,7 +30,7 @@ module.exports = { const account = res.graphql.user; - const embed = new RichEmbed() + const embed = new MessageEmbed() .setColor("RANDOM") .setTitle(account.full_name) .setURL(`https://instagram.com/${name}`) diff --git a/Ep_14/commands/info/whois.js b/Ep_14/commands/info/whois.js index 576c048..9ec78cc 100644 --- a/Ep_14/commands/info/whois.js +++ b/Ep_14/commands/info/whois.js @@ -1,4 +1,4 @@ -const { RichEmbed } = require("discord.js"); +const { MessageEmbed } = require("discord.js"); const { stripIndents } = require("common-tags"); const { getMember, formatDate } = require("../../functions.js"); @@ -19,9 +19,9 @@ module.exports = { // User variables const created = formatDate(member.user.createdAt); - const embed = new RichEmbed() - .setFooter(member.displayName, member.user.displayAvatarURL) - .setThumbnail(member.user.displayAvatarURL) + const embed = new MessageEmbed() + .setFooter(member.displayName, member.user.displayAvatarURL()) + .setThumbnail(member.user.displayAvatarURL()) .setColor(member.displayHexColor === '#000000' ? '#ffffff' : member.displayHexColor) .addField('Member information:', stripIndents`**- Display name:** ${member.displayName} From 3f6ada88cd97acd5753d1edfd35f8e61aacd729d Mon Sep 17 00:00:00 2001 From: Mennoplays Date: Mon, 15 Feb 2021 19:36:42 +0100 Subject: [PATCH 3/4] Updated moderation category to v12 --- Ep_14/commands/moderation/ban.js | 14 +++++++------- Ep_14/commands/moderation/kick.js | 14 +++++++------- Ep_14/commands/moderation/report.js | 12 ++++++------ Ep_14/commands/moderation/say.js | 4 ++-- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Ep_14/commands/moderation/ban.js b/Ep_14/commands/moderation/ban.js index d6eb0e6..1308251 100644 --- a/Ep_14/commands/moderation/ban.js +++ b/Ep_14/commands/moderation/ban.js @@ -1,4 +1,4 @@ -const { RichEmbed } = require("discord.js"); +const { MessageEmbed } = require("discord.js"); const { stripIndents } = require("common-tags"); const { promptMessage } = require("../../functions.js"); @@ -8,7 +8,7 @@ module.exports = { description: "bans the member", usage: "", run: async (client, message, args) => { - const logChannel = message.guild.channels.find(c => c.name === "logs") || message.channel; + const logChannel = message.guild.channels.cache.find(c => c.name === "logs") || message.channel; if (message.deletable) message.delete(); @@ -36,7 +36,7 @@ module.exports = { .then(m => m.delete(5000)); } - const toBan = message.mentions.members.first() || message.guild.members.get(args[0]); + const toBan = message.mentions.members.first() || message.guild.members.cache.get(args[0]); // No member found if (!toBan) { @@ -56,16 +56,16 @@ module.exports = { .then(m => m.delete(5000)); } - const embed = new RichEmbed() + const embed = new MessageEmbed() .setColor("#ff0000") - .setThumbnail(toBan.user.displayAvatarURL) - .setFooter(message.member.displayName, message.author.displayAvatarURL) + .setThumbnail(toBan.user.displayAvatarURL()) + .setFooter(message.member.displayName, message.author.displayAvatarURL()) .setTimestamp() .setDescription(stripIndents`**- baned member:** ${toBan} (${toBan.id}) **- baned by:** ${message.member} (${message.member.id}) **- Reason:** ${args.slice(1).join(" ")}`); - const promptEmbed = new RichEmbed() + const promptEmbed = new MessageEmbed() .setColor("GREEN") .setAuthor(`This verification becomes invalid after 30s.`) .setDescription(`Do you want to ban ${toBan}?`) diff --git a/Ep_14/commands/moderation/kick.js b/Ep_14/commands/moderation/kick.js index 6983cb2..344c0fe 100644 --- a/Ep_14/commands/moderation/kick.js +++ b/Ep_14/commands/moderation/kick.js @@ -1,4 +1,4 @@ -const { RichEmbed } = require("discord.js"); +const { MessageEmbed } = require("discord.js"); const { stripIndents } = require("common-tags"); const { promptMessage } = require("../../functions.js"); @@ -8,7 +8,7 @@ module.exports = { description: "Kicks the member", usage: "", run: async (client, message, args) => { - const logChannel = message.guild.channels.find(c => c.name === "logs") || message.channel; + const logChannel = message.guild.channels.cache.find(c => c.name === "logs") || message.channel; if (message.deletable) message.delete(); @@ -36,7 +36,7 @@ module.exports = { .then(m => m.delete(5000)); } - const toKick = message.mentions.members.first() || message.guild.members.get(args[0]); + const toKick = message.mentions.members.first() || message.guild.members.cache.get(args[0]); // No member found if (!toKick) { @@ -56,16 +56,16 @@ module.exports = { .then(m => m.delete(5000)); } - const embed = new RichEmbed() + const embed = new MessageEmbed() .setColor("#ff0000") - .setThumbnail(toKick.user.displayAvatarURL) - .setFooter(message.member.displayName, message.author.displayAvatarURL) + .setThumbnail(toKick.user.displayAvatarURL()) + .setFooter(message.member.displayName, message.author.displayAvatarURL()) .setTimestamp() .setDescription(stripIndents`**- Kicked member:** ${toKick} (${toKick.id}) **- Kicked by:** ${message.member} (${message.member.id}) **- Reason:** ${args.slice(1).join(" ")}`); - const promptEmbed = new RichEmbed() + const promptEmbed = new MessageEmbed() .setColor("GREEN") .setAuthor(`This verification becomes invalid after 30s.`) .setDescription(`Do you want to kick ${toKick}?`) diff --git a/Ep_14/commands/moderation/report.js b/Ep_14/commands/moderation/report.js index 323e8bd..b261f87 100644 --- a/Ep_14/commands/moderation/report.js +++ b/Ep_14/commands/moderation/report.js @@ -1,4 +1,4 @@ -const { RichEmbed } = require("discord.js"); +const { MessageEmbed } = require("discord.js"); const { stripIndents } = require("common-tags"); module.exports = { @@ -9,7 +9,7 @@ module.exports = { run: async (client, message, args) => { if (message.deletable) message.delete(); - let rMember = message.mentions.members.first() || message.guild.members.get(args[0]); + let rMember = message.mentions.members.first() || message.guild.members.cache.get(args[0]); if (!rMember) return message.reply("Couldn't find that person?").then(m => m.delete(5000)); @@ -20,16 +20,16 @@ module.exports = { if (!args[1]) return message.channel.send("Please provide a reason for the report").then(m => m.delete(5000)); - const channel = message.guild.channels.find(c => c.name === "reports") + const channel = message.guild.channels.cache.find(c => c.name === "reports") if (!channel) return message.channel.send("Couldn't find a `#reports` channel").then(m => m.delete(5000)); - const embed = new RichEmbed() + const embed = new MessageEmbed() .setColor("#ff0000") .setTimestamp() - .setFooter(message.guild.name, message.guild.iconURL) - .setAuthor("Reported member", rMember.user.displayAvatarURL) + .setFooter(message.guild.name, message.guild.iconURL()) + .setAuthor("Reported member", rMember.user.displayAvatarURL()) .setDescription(stripIndents`**- Member:** ${rMember} (${rMember.user.id}) **- Reported by:** ${message.member} **- Reported in:** ${message.channel} diff --git a/Ep_14/commands/moderation/say.js b/Ep_14/commands/moderation/say.js index 8bdf71b..c10f646 100644 --- a/Ep_14/commands/moderation/say.js +++ b/Ep_14/commands/moderation/say.js @@ -1,4 +1,4 @@ -const { RichEmbed } = require("discord.js"); +const { MessageEmbed } = require("discord.js"); module.exports = { name: "say", @@ -17,7 +17,7 @@ module.exports = { const roleColor = message.guild.me.highestRole.hexColor; if (args[0].toLowerCase() === "embed") { - const embed = new RichEmbed() + const embed = new MessageEmbed() .setDescription(args.slice(1).join(" ")) .setColor(roleColor === "#000000" ? "#ffffff" : roleColor); From fb3e45d56418e8fce17ab4d297744e312431bb38 Mon Sep 17 00:00:00 2001 From: Mennoplays Date: Mon, 15 Feb 2021 19:37:51 +0100 Subject: [PATCH 4/4] Updated functions.js to v12 --- Ep_14/functions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Ep_14/functions.js b/Ep_14/functions.js index 789a914..7b96413 100644 --- a/Ep_14/functions.js +++ b/Ep_14/functions.js @@ -2,13 +2,13 @@ module.exports = { getMember: function(message, toFind = '') { toFind = toFind.toLowerCase(); - let target = message.guild.members.get(toFind); + let target = message.guild.members.cache.get(toFind); if (!target && message.mentions.members) target = message.mentions.members.first(); if (!target && toFind) { - target = message.guild.members.find(member => { + target = message.guild.members.cache.find(member => { return member.displayName.toLowerCase().includes(toFind) || member.user.tag.toLowerCase().includes(toFind) });