Linting
This commit is contained in:
@@ -4,12 +4,20 @@ import dotenv from "dotenv";
|
||||
dotenv.config();
|
||||
import { Events } from "discord.js";
|
||||
import { gptHandler } from "../modules/gptHandler.mjs";
|
||||
import { getGuildConfig, setGuildConfig, getConfig, setConfig } from "../../modules/mongo-wrappers/mongoConfigWrappers.mjs";
|
||||
import {
|
||||
getGuildConfig,
|
||||
setGuildConfig,
|
||||
getConfig,
|
||||
setConfig,
|
||||
} from "../../modules/mongo-wrappers/mongoConfigWrappers.mjs";
|
||||
|
||||
export const name = Events.GuildMemberAdd;
|
||||
|
||||
export async function execute(nodeIo, member) {
|
||||
const welcomeChannel = await getGuildConfig(message.guild.id, "welcomeChannelId");
|
||||
export async function execute(nodeIo, member) {
|
||||
const welcomeChannel = await getGuildConfig(
|
||||
message.guild.id,
|
||||
"welcomeChannelId",
|
||||
);
|
||||
log.INFO("New user joined the server", member);
|
||||
let conversation = [];
|
||||
conversation.push({
|
||||
|
||||
@@ -6,19 +6,33 @@ import { Events } from "discord.js";
|
||||
import { gptInteraction } from "../addons/gptInteraction.mjs";
|
||||
import { linkCop } from "../addons/linkCop.mjs";
|
||||
import PresenceManager from "../modules/presenceManager.mjs";
|
||||
import { getGuildConfig, setGuildConfig } from "../../modules/mongo-wrappers/mongoConfigWrappers.mjs";
|
||||
import {
|
||||
getGuildConfig,
|
||||
setGuildConfig,
|
||||
} from "../../modules/mongo-wrappers/mongoConfigWrappers.mjs";
|
||||
|
||||
export const name = Events.MessageCreate;
|
||||
|
||||
export async function execute(nodeIo, message) {
|
||||
// Get the ignored channels from the server config
|
||||
const IGNORED_CHANNELS = await getGuildConfig(message.guild.id, "ignoredChannels");
|
||||
const IGNORED_CHANNELS = await getGuildConfig(
|
||||
message.guild.id,
|
||||
"ignoredChannels",
|
||||
);
|
||||
|
||||
// Ignore ignored channels
|
||||
if (!Array.isArray(IGNORED_CHANNELS) || Array.isArray(IGNORED_CHANNELS) && IGNORED_CHANNELS.includes(message.channel.id)) { return; }
|
||||
if (
|
||||
!Array.isArray(IGNORED_CHANNELS) ||
|
||||
(Array.isArray(IGNORED_CHANNELS) &&
|
||||
IGNORED_CHANNELS.includes(message.channel.id))
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Ignore messages from a bot
|
||||
if (message.author.bot) { return; }
|
||||
if (message.author.bot) {
|
||||
return;
|
||||
}
|
||||
|
||||
log.INFO("Message create", message);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user