diff --git a/src/commands/settings.js b/src/commands/settings.js index 2324235..e19b3c8 100644 --- a/src/commands/settings.js +++ b/src/commands/settings.js @@ -52,6 +52,7 @@ module.exports = class SettingsCommand extends Command { cat_row.name_format = c.name_format; cat_row.opening_message = c.opening_message; cat_row.opening_questions = c.opening_questions; + cat_row.ping = c.ping; cat_row.require_topic = c.require_topic; cat_row.roles = c.roles; cat_row.survey = c.survey; @@ -111,6 +112,7 @@ module.exports = class SettingsCommand extends Command { name_format: c.name_format, opening_message: c.opening_message, opening_questions: c.opening_questions, + ping: c.ping, require_topic: c.require_topic, roles: c.roles, survey: c.survey @@ -162,6 +164,7 @@ module.exports = class SettingsCommand extends Command { name_format: c.name_format, opening_message: c.opening_message, opening_questions: c.opening_questions, + ping: c.ping, require_topic: c.require_topic, roles: c.roles, survey: c.survey diff --git a/src/database/models/category.model.js b/src/database/models/category.model.js index 4bd4533..1fb4784 100644 --- a/src/database/models/category.model.js +++ b/src/database/models/category.model.js @@ -46,6 +46,10 @@ module.exports = ({ config }, sequelize) => { type: DataTypes.JSON, allowNull: true, }, + ping: { + type: DataTypes.JSON, + defaultValue: [], + }, require_topic: { type: DataTypes.BOOLEAN, defaultValue: false, diff --git a/src/modules/tickets/manager.js b/src/modules/tickets/manager.js index e86c4f8..e2704f5 100644 --- a/src/modules/tickets/manager.js +++ b/src/modules/tickets/manager.js @@ -37,6 +37,16 @@ module.exports = class TicketManager extends EventEmitter { ? this.client.cryptr.decrypt(t_row.topic) : ''; + if (cat_row.ping instanceof Array) { + let mentions = cat_row.ping.map(id => id === 'everyone' + ? '@everyone' + : id === 'here' + ? '@here' + : `<@&${id}>`); + + await t_channel.send(mentions.join(', ')); + } + await t_channel.send(member.user.toString()); if (cat_row.image) {