Fixes and improvements for database and other things

Also continued to add to ticket creation stuff - now includes opening questions
This commit is contained in:
Isaac
2021-04-25 15:40:07 +01:00
parent 674f29b403
commit db94bf6969
16 changed files with 245 additions and 189 deletions

View File

@@ -61,6 +61,27 @@ module.exports = class CommandManager {
* @param {Message} message - Command message
*/
async handle(message) {
let is_blacklisted = false;
if (settings.blacklist.includes(message.author.id)) {
is_blacklisted = true;
this.client.log.info(`Ignoring blacklisted member ${message.author.tag}`);
} else {
settings.blacklist.forEach(element => {
if (message.guild.roles.cache.has(element) && message.member.roles.cache.has(element)) {
is_blacklisted = true;
this.client.log.info(`Ignoring member ${message.author.tag} with blacklisted role`);
}
});
}
if (is_blacklisted) {
try {
return message.react('❌');
} catch (error) {
return this.client.log.warn('Failed to react to a message');
}
}
let settings = await message.guild.settings;
const i18n = this.client.i18n.get(settings.locale);