From 101d7b18a43bd4e169063c3f38955fa1163bd6e0 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Sat, 2 May 2020 00:10:44 +0200 Subject: [PATCH] Replaced username and discriminator with tag Signed-off-by: loicbersier --- commands/owner/addDonator.js | 12 ++++++------ commands/owner/blacklist.js | 8 ++++---- commands/utility/about.js | 8 ++++---- commands/utility/donator.js | 2 +- event/listeners/commandblocked.js | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/commands/owner/addDonator.js b/commands/owner/addDonator.js index 4dc3678..35fc8c2 100644 --- a/commands/owner/addDonator.js +++ b/commands/owner/addDonator.js @@ -43,21 +43,21 @@ class addDonatorCommand extends Command { if (!Donator) { const body = {userID: args.id, comment: userComment}; donator.create(body); - return message.channel.send(`A new donator have been added! ${this.client.users.resolve(args.id).username}#${this.client.users.resolve(args.id).discriminator} (${args.id}) ${userComment}`); + return message.channel.send(`A new donator have been added! ${this.client.users.resolve(args.id).tag} (${args.id}) ${userComment}`); } else { message.channel.send('This donator already exist, do you want to update it? y/n'); - const filter = m => m.content && m.author.id == message.author.id; + const filter = m => m.content && m.author.id === message.author.id; message.channel.awaitMessages(filter, {time: 5000 * 1000, max: 1, errors: ['time'] }) .then(messages => { let messageContent = messages.map(messages => messages.content); - if (messageContent == 'y' || messageContent == 'yes') { + if (messageContent === 'y' || messageContent === 'yes') { const body = {comment: userComment}; donator.update(body, {where: {userID: args.id}}); console.log(userComment); - if (userComment == '') { - return message.channel.send(`Removed the comment from ${this.client.users.resolve(args.id).username}#${this.client.users.resolve(args.id).discriminator} (${args.id})`); + if (userComment === '') { + return message.channel.send(`Removed the comment from ${this.client.users.resolve(args.id).tag} (${args.id})`); } else { - return message.channel.send(`You edited the comment for ${this.client.users.resolve(args.id).username}#${this.client.users.resolve(args.id).discriminator} (${args.id}) with ${args.userComment}`); + return message.channel.send(`You edited the comment for ${this.client.users.resolve(args.id).tag} (${args.id}) with ${args.userComment}`); } } }) diff --git a/commands/owner/blacklist.js b/commands/owner/blacklist.js index 83713c0..0d55ff6 100644 --- a/commands/owner/blacklist.js +++ b/commands/owner/blacklist.js @@ -32,16 +32,16 @@ class blacklistCommand extends Command { if (!blacklist) { const body = {userID: args.userID}; userBlacklist.create(body); - return message.channel.send(`The following user have been blacklisted: ${this.client.users.resolve(args.userID).username}#${this.client.users.resolve(args.userID).discriminator} (${args.userID})`); + return message.channel.send(`The following user have been blacklisted: ${this.client.users.resolve(args.userID).tag} (${args.userID})`); } else { message.channel.send('This user is already blacklisted, do you want to unblacklist him? y/n'); - const filter = m => m.content && m.author.id == message.author.id; + const filter = m => m.content && m.author.id === message.author.id; message.channel.awaitMessages(filter, {time: 5000 * 1000, max: 1, errors: ['time'] }) .then(messages => { let messageContent = messages.map(messages => messages.content); - if (messageContent == 'y' || messageContent == 'yes') { + if (messageContent === 'y' || messageContent === 'yes') { userBlacklist.destroy({where: {userID:args.userID}}); - return message.channel.send(`The following user have been unblacklisted: ${this.client.users.resolve(args.userID).username}#${this.client.users.resolve(args.userID).discriminator} (${args.userID})`); + return message.channel.send(`The following user have been unblacklisted: ${this.client.users.resolve(args.userID).tag} (${args.userID})`); } }) .catch(err => { diff --git a/commands/utility/about.js b/commands/utility/about.js index 52e42c8..e553c44 100644 --- a/commands/utility/about.js +++ b/commands/utility/about.js @@ -20,11 +20,11 @@ class aboutCommand extends Command { async exec(message) { const Donator = await donator.findAll({order: ['id']}); - let description = `This bot is made using [discord.js](https://github.com/discordjs/discord.js) & [Discord-Akairo](https://github.com/discord-akairo/discord-akairo)\nHelp command from [hoshi](https://github.com/1Computer1/hoshi)\n[Rantionary](https://github.com/RantLang/Rantionary) for their dictionnary.\nThanks to ${this.client.users.resolve('336492042299637771').username}#${this.client.users.resolve('336492042299637771').discriminator} (336492042299637771) for inspiring me for making this bot!\n\nThe people who donated for the bot <3\n`; + let description = `This bot is made using [discord.js](https://github.com/discordjs/discord.js) & [Discord-Akairo](https://github.com/discord-akairo/discord-akairo)\nHelp command from [hoshi](https://github.com/1Computer1/hoshi)\n[Rantionary](https://github.com/RantLang/Rantionary) for their dictionnary.\nThanks to ${this.client.users.resolve('336492042299637771').tag} (336492042299637771) for inspiring me for making this bot!\n\nThe people who donated for the bot <3\n`; if (Donator[0]) { for (let i = 0; i < Donator.length; i++) { - description += `**${this.client.users.resolve(Donator[i].get('userID')).username}#${this.client.users.resolve(Donator[i].get('userID')).discriminator} (${Donator[i].get('userID')}) | ${Donator[i].get('comment')}**\n`; + description += `**${this.client.users.resolve(Donator[i].get('userID')).tag} (${Donator[i].get('userID')}) | ${Donator[i].get('comment')}**\n`; } } else { description += 'No one :(\n'; @@ -40,11 +40,11 @@ class aboutCommand extends Command { .setTitle('About me') .setDescription(description) .addField('Current commit', out.stdout) - .addField('Current owner: ', `${this.client.users.resolve(this.client.ownerID).username}#${this.client.users.resolve(this.client.ownerID).discriminator} (${this.client.ownerID})`) + .addField('Current owner: ', `${this.client.users.resolve(this.client.ownerID).tag} (${this.client.ownerID})`) .addField('Gitlab', 'https://gitlab.com/LoicBersier/DiscordBot', true) .addField('Github', 'https://github.com/loicbersier/Haha-yes', true) .setThumbnail('https://its.gamingti.me/ZiRe.png') - .setFooter(`Original bot made by ${this.client.users.resolve('267065637183029248').username}#${this.client.users.resolve('267065637183029248').discriminator} (267065637183029248)`); // Please don't change the "original bot made by" + .setFooter(`Original bot made by ${this.client.users.resolve('267065637183029248').tag} (267065637183029248)`); // Please don't change the "original bot made by" message.channel.send(aboutEmbed); }); diff --git a/commands/utility/donator.js b/commands/utility/donator.js index 66a0d5e..cc28529 100644 --- a/commands/utility/donator.js +++ b/commands/utility/donator.js @@ -22,7 +22,7 @@ class donatorCommand extends Command { if (Donator[0]) { for (let i = 0; i < Donator.length; i++) { - donatorMessage += `**${this.client.users.resolve(Donator[i].get('userID')).username}#${this.client.users.resolve(Donator[i].get('userID')).discriminator} (${Donator[i].get('userID')}) | ${Donator[i].get('comment')}**\n`; + donatorMessage += `**${this.client.users.resolve(Donator[i].get('userID')).tag} (${Donator[i].get('userID')}) | ${Donator[i].get('comment')}**\n`; } } else { donatorMessage += 'No one :('; diff --git a/event/listeners/commandblocked.js b/event/listeners/commandblocked.js index 1118063..4153039 100644 --- a/event/listeners/commandblocked.js +++ b/event/listeners/commandblocked.js @@ -38,7 +38,7 @@ class CommandBlockedListener extends Listener { break; case 'serverblacklist': Embed.setTitle('Server blacklisted.'); - Embed.setDescription(`This server have been blacklisted... to appeal contact ${this.client.users.resolve(this.client.ownerID).username}#${this.client.users.resolve(this.client.ownerID).discriminator}, and now i will yeet out of here`); + Embed.setDescription(`This server have been blacklisted... to appeal contact ${this.client.users.resolve(this.client.ownerID).tag}, and now i will yeet out of here`); message.channel.send(Embed); message.guild.leave(); break;