Implement Dynamic Presence #19

## Added Dynamic Presence to Functions
- Added default to startup
- Added to RSS manager
- Added to interaction create event
- Added to message create function

## Related Work #15
### LinkCop
- Updated with new regex string and logic approved and restricted channels
- Implemented new config storage
### Guild Member Add (event)
- Implemented new config storage for welcome channel
### Message Create (event)
- Implemented new config storage for ignored channel IDs
- Improved the logic for gpt interactions to reset presence
### Mongo Config Wrappers
- Updated logic in order to handle different data types the same way
- Updated set functions to wrap the value in the key
- Updated get functions to return the keyyed value ie `config[key]`
This commit is contained in:
Logan Cusano
2024-08-11 20:13:57 -04:00
parent d18ffd4c11
commit 94374b4d45
7 changed files with 73 additions and 30 deletions

View File

@@ -4,12 +4,12 @@ import dotenv from "dotenv";
dotenv.config();
import { Events } from "discord.js";
import { gptHandler } from "../modules/gptHandler.mjs";
const welcomeChannel = process.env.WELCOME_CHANNEL_ID; // TODO - Need to add a DB section for server configs so it's not static to one server
import { getGuildConfig, setGuildConfig, getConfig, setConfig } from "../../modules/mongo-wrappers/mongoConfigWrappers.mjs";
export const name = Events.GuildMemberAdd;
export async function execute(nodeIo, member) {
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({