configurable inline response

This commit is contained in:
Erik 2022-01-27 15:01:41 +02:00
parent a5ea2be87a
commit 956807ab09
No known key found for this signature in database
GPG Key ID: FEFF4B220DDF5589
2 changed files with 3 additions and 1 deletions

View File

@ -18,6 +18,7 @@ module.exports = {
modmailReminderInterval: 10, // How often the bot should send a reminder of x new modmails in queue
modmailReminderChannel: '', // channel to send reminders in
logChannel: '', // Channel in which modmail logs are sent
inlineResponse: null, // The response the bot gives when a user DMs the bot, null will have the bot use the default
clientOptions: {
intents: [ // Needs at least these
'GUILDS',

View File

@ -22,6 +22,7 @@ class Modmail {
this._reminderChannel = opts.modmailReminderChannel || null;
this._logChannel = opts.logChannel || null;
this.categories = opts.modmailCategory;
this.inlineResponse = opts.inlineResponse || `Thank you for your message, we'll get back to you soon!`;
this.updatedThreads = [];
this.queue = [];
@ -143,7 +144,7 @@ class Modmail {
const lastActivity = this.cache.lastActivity[author.id];
if (!lastActivity || now - lastActivity > 30 * 60) { // No point in sending this for *every* message
await author.send(`Thank you for your message, we'll get back to you soon!`);
await author.send(this.inlineResponse);
}
this.cache.lastActivity[author.id] = now;