1
1
mirror of https://github.com/Burn-E99/GroupUp.git synced 2026-06-04 08:53:49 -04:00

Move creation fields to common location to reuse for editing

also fix bot deleting own messages like an idiot
This commit is contained in:
Ean Milligan (Bastion)
2023-04-25 04:31:12 -04:00
parent 7352554ddf
commit 75aeda6195
4 changed files with 70 additions and 61 deletions

View File

@@ -5,6 +5,9 @@ import { infoEmbed } from '../commandUtils.ts';
import { dbClient, generateGuildSettingKey, lfgChannelSettings, queries } from '../db.ts';
export const messageCreate = async (bot: Bot, message: Message) => {
// Ignore self
if (botId === message.authorId) return;
// Delete all messages sent to a LFG Channel
if (lfgChannelSettings.has(generateGuildSettingKey(message.guildId || 0n, message.channelId))) {
bot.helpers.deleteMessage(message.channelId, message.id, 'Cleaning LFG Channel').catch((e: Error) => utils.commonLoggers.messageDeleteError('messageCreate.ts', 'Clean LFG Channel', e));