From b23f6b9a9877d90e2387145b64518772ba5c732f Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Mon, 2 May 2022 01:27:30 +0300 Subject: [PATCH] small fixes --- src/structure/client/RateLimiter.js | 12 ++++++------ src/structure/components/settings/logging/Members.js | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/structure/client/RateLimiter.js b/src/structure/client/RateLimiter.js index f54ef60..ebd108f 100644 --- a/src/structure/client/RateLimiter.js +++ b/src/structure/client/RateLimiter.js @@ -43,13 +43,13 @@ class RateLimiter { this.deleteQueue[channel.id].push({ message, resolve, reject }); //if(!this.deleteTimeouts[channel.id] || this.deleteTimeouts[channel.id]._destroyed) this.deleteTimeouts[channel.id] = setTimeout(this.delete.bind(this), this.deleteInterval*1000, channel); - this.delete(channel); + this._delete(channel); }); } - async delete(channel) { + async _delete(channel) { if (!this.deleteQueue[channel.id] || !this.deleteQueue[channel.id].length) return; @@ -116,13 +116,13 @@ class RateLimiter { //Check if an active timeout exists, if not, create one if (!this.sendTimeouts[channel.id] || this.sendTimeouts[channel.id]._destroyed) - this.sendTimeouts[channel.id] = setTimeout(this.send.bind(this), this.sendInterval * 1000, channel); + this.sendTimeouts[channel.id] = setTimeout(this._send.bind(this), this.sendInterval * 1000, channel); }); } - async send(channel) { + async _send(channel) { if (!this.sendQueue[channel.id] || !this.sendQueue[channel.id].length) return; @@ -139,7 +139,7 @@ class RateLimiter { temp = `\n${message}`; if (sendThis.length + temp.length > 2000) { //Max length message, send the remaining messages at the next send - this.sendTimeouts[channel.id] = setTimeout(this.send.bind(this), this.sendInterval * 1000, [channel]); + this.sendTimeouts[channel.id] = setTimeout(this._send.bind(this), this.sendInterval * 1000, [channel]); break; } else { sendThis += temp; @@ -171,7 +171,7 @@ class RateLimiter { * Useful for stopping multiple instances of "Invites aren't permitted" being sent * * @param {TextChannel} channel channel in which to send - * @param {String} message the message to send + * @param {Object} message the message object to send, passed directly to channel.send * @param {Number} [limit=15] how frequently the message can send * @param {String} utility Limit by utility, ex invitefilter or messagefilter - so they don't overlap * @returns {Promise} The message object of the sent message diff --git a/src/structure/components/settings/logging/Members.js b/src/structure/components/settings/logging/Members.js index 6508080..9446a34 100644 --- a/src/structure/components/settings/logging/Members.js +++ b/src/structure/components/settings/logging/Members.js @@ -60,10 +60,10 @@ class MemberLog extends Setting { inline: true }, { name: 'SETTING_MEMBERLOG_JOIN', - value: setting.join || '**N/A**', + value: setting.join ? `\`${setting.join}\`` : '**N/A**', }, { name: 'SETTING_MEMBERLOG_LEAVE', - value: setting.leave || '**N/A**', + value: setting.leave ? `\`${setting.leave}\`` : '**N/A**', } ];