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:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user