Add newThreadCategoryId option
parent
ccb6f7345b
commit
b2d9c93f43
|
@ -1,9 +1,12 @@
|
|||
# Changelog
|
||||
|
||||
## Sep 22, 2017
|
||||
* Added `newThreadCategoryId` option. This option can be set to a category ID to place all new threads in that category.
|
||||
|
||||
## Sep 20, 2017
|
||||
* Fixed crash when the bot was unable to find or create a modmail thread
|
||||
* Reduced error log spam in case of network errors from Eris
|
||||
* Fix unintended error when a message was ignored due to an "accidental thread" word
|
||||
* Fixed unintended error when a message was ignored due to an "accidental thread" word
|
||||
|
||||
## Sep 19, 2017
|
||||
* Added `logChannelId` option
|
||||
|
|
|
@ -59,3 +59,4 @@ These go in `config.json`. See also `config.example.json`.
|
|||
|snippetPrefix|"!!"|Prefix to use snippets. Defaults to `prefix` x2.|
|
||||
|inboxServerPermission|None|Permission required to use bot commands on the inbox server|
|
||||
|logChannelId|Server's default channel|Channel where to post links to closed threads and other alerts|
|
||||
|newThreadCategoryId|None|ID of the category where new modmail thread channels should be placed|
|
||||
|
|
|
@ -18,6 +18,8 @@ const defaultConfig = {
|
|||
"status": "Message me for help!",
|
||||
"responseMessage": "Thank you for your message! Our mod team will reply to you here as soon as possible.",
|
||||
|
||||
"newThreadCategoryId": null,
|
||||
|
||||
"inboxServerPermission": null,
|
||||
"alwaysReply": false,
|
||||
"alwaysReplyAnon": false,
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
const Eris = require('eris');
|
||||
const bot = require('./bot');
|
||||
const transliterate = require('transliteration');
|
||||
const jsonDb = require('./jsonDb');
|
||||
const config = require('./config');
|
||||
|
@ -93,6 +94,11 @@ function getForUser(user, allowCreate = true, originalMessage = null) {
|
|||
username: `${user.username}#${user.discriminator}`,
|
||||
};
|
||||
|
||||
if (config.newThreadCategoryId) {
|
||||
// If a category id is specified, move the newly created channel there
|
||||
bot.editChannel(channel.id, {parentID: config.newThreadCategoryId});
|
||||
}
|
||||
|
||||
return jsonDb.get('threads', []).then(threads => {
|
||||
threads.push(thread);
|
||||
jsonDb.save('threads', threads);
|
||||
|
|
Loading…
Reference in New Issue