forked from Galactic/galactic-bot
small fixes
This commit is contained in:
parent
233bd54cc1
commit
b23f6b9a98
@ -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<Message>} The message object of the sent message
|
||||
|
@ -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**',
|
||||
}
|
||||
];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user