From 32e2c0a7c879e24d5dded0eec952012c8eda3ea6 Mon Sep 17 00:00:00 2001 From: Chemie~ <13520392+LunarTwilight@users.noreply.github.com> Date: Fri, 16 Aug 2024 12:09:49 -0800 Subject: [PATCH 1/3] escape join/leave message --- src/plugins/joinleave/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/plugins/joinleave/index.js b/src/plugins/joinleave/index.js index 9e2cc73..2dc3ba6 100644 --- a/src/plugins/joinleave/index.js +++ b/src/plugins/joinleave/index.js @@ -1,7 +1,14 @@ const Plugin = require('../../structs/Plugin.js'); const Cache = require('../../structs/Cache.js'); +const FormatterPlugin = require('../fmt'); class JoinLeavePlugin extends Plugin { + static get deps() { + return [ + FormatterPlugin + ]; + } + load() { this.bot.joinleave = new JoinLeave(this.bot); } @@ -138,7 +145,7 @@ class JoinLeave { return vars[name]; } - return full; + return this.bot.fmt.escape(full); }); } From e1b3e35a1c9e6e6396ffb3ada10887cbfcfe2931 Mon Sep 17 00:00:00 2001 From: Chemie~ <13520392+LunarTwilight@users.noreply.github.com> Date: Fri, 16 Aug 2024 12:21:06 -0800 Subject: [PATCH 2/3] escape just the username instead of the full message incase the join/leave message has markdown in it intentionally --- src/plugins/joinleave/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/joinleave/index.js b/src/plugins/joinleave/index.js index 2dc3ba6..7234344 100644 --- a/src/plugins/joinleave/index.js +++ b/src/plugins/joinleave/index.js @@ -133,7 +133,7 @@ class JoinLeave { getVars(member) { return { USERID: member.user.id, - USERNAME: member.user.username, + USERNAME: this.bot.fmt.escape(member.user.username), USERDISCRIM: member.user.discriminator }; } @@ -145,7 +145,7 @@ class JoinLeave { return vars[name]; } - return this.bot.fmt.escape(full); + return full; }); } From 1d76684efbaeca00e6c64b055c6c44ad5448ccf5 Mon Sep 17 00:00:00 2001 From: Chemie~ <13520392+LunarTwilight@users.noreply.github.com> Date: Fri, 16 Aug 2024 14:20:31 -0800 Subject: [PATCH 3/3] need to pass what to escape too using an underscore per discord convo --- src/plugins/joinleave/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/joinleave/index.js b/src/plugins/joinleave/index.js index 7234344..086da7b 100644 --- a/src/plugins/joinleave/index.js +++ b/src/plugins/joinleave/index.js @@ -133,7 +133,7 @@ class JoinLeave { getVars(member) { return { USERID: member.user.id, - USERNAME: this.bot.fmt.escape(member.user.username), + USERNAME: this.bot.fmt.escape(member.user.username, '_'), USERDISCRIM: member.user.discriminator }; }