Linting
This commit is contained in:
@@ -1,29 +1,29 @@
|
||||
import { DebugBuilder } from "../../modules/debugger.mjs";
|
||||
const log = new DebugBuilder("server", "discordBot.events.messageCreate");
|
||||
import dotenv from 'dotenv';
|
||||
import dotenv from "dotenv";
|
||||
dotenv.config();
|
||||
import { Events } from 'discord.js';
|
||||
import { gptInteraction } from '../addons/gptInteraction.mjs';
|
||||
import { linkCop } from '../addons/linkCop.mjs';
|
||||
import { Events } from "discord.js";
|
||||
import { gptInteraction } from "../addons/gptInteraction.mjs";
|
||||
import { linkCop } from "../addons/linkCop.mjs";
|
||||
|
||||
const IGNORED_CHANNELS = process.env.IGNORED_CHANNEL_IDS.split(',');
|
||||
const IGNORED_CHANNELS = process.env.IGNORED_CHANNEL_IDS.split(",");
|
||||
|
||||
export const name = Events.MessageCreate;
|
||||
|
||||
export async function execute(nodeIo, message) {
|
||||
// Ignore ignored channels
|
||||
if (IGNORED_CHANNELS.includes(message.channel.id)) return;
|
||||
// Ignore ignored channels
|
||||
if (IGNORED_CHANNELS.includes(message.channel.id)) return;
|
||||
|
||||
// Ignore messages from a bot
|
||||
if (message.author.bot) return;
|
||||
// Ignore messages from a bot
|
||||
if (message.author.bot) return;
|
||||
|
||||
log.INFO("Message create", message);
|
||||
log.INFO("Message create", message);
|
||||
|
||||
// Check if the message mentions the bot
|
||||
if (message.mentions.users.has(nodeIo.serverClient.user.id)) {
|
||||
return await gptInteraction(nodeIo, message);
|
||||
}
|
||||
// Check if the message mentions the bot
|
||||
if (message.mentions.users.has(nodeIo.serverClient.user.id)) {
|
||||
return await gptInteraction(nodeIo, message);
|
||||
}
|
||||
|
||||
// Check if the message contains a link in a channel it shouldn't
|
||||
if (await linkCop(nodeIo, message)) return;
|
||||
}
|
||||
// Check if the message contains a link in a channel it shouldn't
|
||||
if (await linkCop(nodeIo, message)) return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user