diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-03-13 21:55:10 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-03-13 21:55:10 -0400 |
commit | 142fe78f76d1e04b480da09f5e36cb70b98e24ff (patch) | |
tree | e0879d8ed963b36e8dda88018e79e718263b1d76 /src/listeners/message | |
parent | 8cd475cb42e8daf921343ea5bac28ddd541d248f (diff) | |
download | tanzanite-142fe78f76d1e04b480da09f5e36cb70b98e24ff.tar.gz tanzanite-142fe78f76d1e04b480da09f5e36cb70b98e24ff.tar.bz2 tanzanite-142fe78f76d1e04b480da09f5e36cb70b98e24ff.zip |
fix(supportThread): don't trigger on zepplin messages
Diffstat (limited to 'src/listeners/message')
-rw-r--r-- | src/listeners/message/autoThread.ts | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/src/listeners/message/autoThread.ts b/src/listeners/message/autoThread.ts deleted file mode 100644 index 540f479..0000000 --- a/src/listeners/message/autoThread.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { BushListener, type BushClientEvents, type BushTextChannel } from '#lib'; -import { Embed, GuildTextBasedChannel, MessageType, PermissionFlagsBits } from 'discord.js'; - -export default class autoThreadListener extends BushListener { - public constructor() { - super('autoThread', { - emitter: 'client', - event: 'messageCreate', - category: 'message' - }); - } - - public override async exec(...[message]: BushClientEvents['messageCreate']): Promise<Promise<void> | undefined> { - if (!client.config.isProduction) return; - if (!message.guild || !message.channel) return; - if (![MessageType.Default, MessageType.Reply].includes(message.type)) return; - if ( - message.author.bot && - message.author.id === '444871677176709141' && //fire - message.content.includes('has been banished from') && - message.content.includes('<:yes:822211477624586260>') - ) - return; - - if ( - (message.content.trim().startsWith(await message.guild.getSetting('prefix')) || - message.content.trim().startsWith(`<@!${client.user!.id}>`) || - message.content.trim().startsWith(`<@${client.user!.id}>`)) && - client.commandHandler.aliases.some((alias) => message.content.includes(alias)) - ) - return; - - if (message.thread) return; - - // todo: make these configurable etc... - if (message.guild.id !== '516977525906341928') return; // mb - if (message.channel.id !== '714332750156660756') return; // neu-support-1 - if (!(message.channel as BushTextChannel).permissionsFor(message.guild.me!).has(PermissionFlagsBits.CreatePublicThreads)) - return; - const thread = await message - .startThread({ - name: `Support - ${message.author.username}#${message.author.discriminator}`, - autoArchiveDuration: 60, - reason: 'Support Thread' - }) - .catch(() => null); - if (!thread) return; - const embed = new Embed() - .setTitle('NotEnoughUpdates Support') - .setDescription( - `Welcome to Moulberry Bush Support:tm:\n\nPlease make sure you have the latest version found in <#693586404256645231>.\nAdditionally if you need help installing the mod be sure to read <#737444942724726915> for a guide on how to do so.` - ) - .setColor(util.colors.Blurple); - void thread - .send({ embeds: [embed] }) - .then(() => - client.console.info( - 'supportThread', - `opened a support thread for <<${message.author.tag}>> in <<${(message.channel as GuildTextBasedChannel).name}>> in <<${ - message.guild!.name - }>>.` - ) - ); - } -} |