From e154a86931134ebac848311698ac80a2bbc499fe Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Fri, 26 Feb 2021 12:55:29 -0700 Subject: [PATCH] bugfixes --- commands/clearstatus.js | 2 +- commands/deathnote.js | 2 +- commands/hug.js | 2 +- responses/wubzy.js | 3 +++ util/response/getresponse.js | 2 +- util/siftstatuses.js | 2 +- 6 files changed, 8 insertions(+), 5 deletions(-) diff --git a/commands/clearstatus.js b/commands/clearstatus.js index 0c46737..c133b52 100644 --- a/commands/clearstatus.js +++ b/commands/clearstatus.js @@ -21,6 +21,6 @@ module.exports = { tu.statustype = ''; tu.save(); require('../util/siftstatuses')(client, message.author.id, true); - return message.reply("welcome back! I cleared your status.").then(m => {m.delete({timeout: 5000}).then(() => {message.delete().catch(() => {});})}); + return message.reply("welcome back! I cleared your status.").then(m => {m.delete({timeout: 5000}).then(() => {if (message.guild && message.guild.me.permissions.has("DELETE_MESSAGES")) {message.delete().catch(() => {});}})}); } }; \ No newline at end of file diff --git a/commands/deathnote.js b/commands/deathnote.js index fe46d74..236e162 100644 --- a/commands/deathnote.js +++ b/commands/deathnote.js @@ -132,7 +132,7 @@ module.exports = { let finalEmbed = new Discord.MessageEmbed() .setAuthor(title, message.author.avatarURL()) - .setDescription(`${text}${dns ? `\n\n_Their name is in your deathnote **${dns.total === 1 ? 'once' : `${dns.total} times`}.**_` : ''}`) + .setDescription(`${text}${dns ? `\n\n_Their name is in your deathnote **${dns.against[mention.id] === 1 ? 'once' : `${dns.against[mention.id]} times`}.**_` : ''}`) .setColor('c375f0') .setFooter(`Natsuki${dns ? ` | ${dns.total} name${dns.total === 1 ? ' has been' : 's'} written in your deathnote!` : ''}`) .setTimestamp(); diff --git a/commands/hug.js b/commands/hug.js index 0dfd2b7..9b7446f 100644 --- a/commands/hug.js +++ b/commands/hug.js @@ -39,7 +39,7 @@ module.exports = { hugs.save(); return message.channel.send(new Discord.MessageEmbed() .setAuthor(`${message.guild ? message.member.displayName : message.author.username} gives ${message.guild.members.cache.get(mention.id).displayName} a hug!`, message.author.avatarURL()) - .setDescription(`You've hugged them **${hugs.total === 1 ? 'once' : `${hugs.total} times!`}**`) + .setDescription(`You've hugged them **${hugs.against[mention.id] === 1 ? 'once' : `${hugs.against[mention.id]} times!`}**`) .setImage(String(Array.from(saves.values())[Math.floor(Math.random() * saves.size)])) .setColor('52c7bb') .setFooter(`${hugs.total} hug${hugs.total === 1 ? '' : 's'} total`) diff --git a/responses/wubzy.js b/responses/wubzy.js index 2735786..54104f6 100644 --- a/responses/wubzy.js +++ b/responses/wubzy.js @@ -91,5 +91,8 @@ module.exports = { return; } else {return message.channel.send("Watching anime in incognito are we? I gotcha :p");} } + if (['hey natsuki', 'hey natsuki?', 'yo natsuki'].includes(msg.trim())) { + let r = ["What's up?", "Hm?", "How can I help?", "Heya ^^", "Hey there Wubbo", "What's up Wubzy?", "Soup", "hehe sup"]; + } } }; \ No newline at end of file diff --git a/util/response/getresponse.js b/util/response/getresponse.js index 55bc7f0..b23f427 100644 --- a/util/response/getresponse.js +++ b/util/response/getresponse.js @@ -4,6 +4,6 @@ module.exports = async (message, name) => { let tr = await Responses.findOne({gid: message.guild.id}); if (!tr) {message.reply("This server does not have any responses saved!"); return null;} if (!tr.responses.has(name.toLowerCase())) {message.reply("I don't have that response saved here."); return null;} - message.delete(); + if (message.guild.me.permissions.has("DELETE_MESSAGES")) {message.delete();} return tr.responses.get(name.toLowerCase()); }; \ No newline at end of file diff --git a/util/siftstatuses.js b/util/siftstatuses.js index 320526e..1bfd1d3 100644 --- a/util/siftstatuses.js +++ b/util/siftstatuses.js @@ -18,7 +18,7 @@ module.exports = async function (client, lookFor, forceClear) { tu.statustype = ''; tu.save(); let u = await client.users.fetch(status.id); - if (u) {u.send("Heya! Your status has been set for 12 hours, so I've cleared it for you.").catch(() => {});} + if (u && !forceClear) {u.send("Heya! Your status has been set for 12 hours, so I've cleared it for you.").catch(() => {});} } } else {ns.push(status);} }