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:
@@ -1,6 +1,7 @@
|
||||
import { DebugBuilder } from "../../modules/debugger.mjs";
|
||||
const log = new DebugBuilder("server", "discordBot.events.interactionCreate");
|
||||
import { Events } from "discord.js";
|
||||
import PresenceManager from "../modules/presenceManager.mjs";
|
||||
|
||||
export const name = Events.InteractionCreate;
|
||||
|
||||
@@ -8,6 +9,10 @@ export async function execute(nodeIo, interaction) {
|
||||
const command = interaction.client.commands.get(interaction.commandName);
|
||||
log.INFO("Interaction created for command: ", command);
|
||||
|
||||
// Set the presence for handling interaction
|
||||
const interactionPm = new PresenceManager(interaction.client);
|
||||
await interactionPm.setPresence("online", "PLAYING", "handling interaction");
|
||||
|
||||
// Execute autocomplete if the user is checking autocomplete
|
||||
if (interaction.isAutocomplete()) {
|
||||
log.INFO("Running autocomplete for command: ", command.data.name);
|
||||
@@ -33,4 +38,7 @@ export async function execute(nodeIo, interaction) {
|
||||
|
||||
// Execute the command
|
||||
command.execute(nodeIo, interaction);
|
||||
|
||||
// Reset the presence
|
||||
await interactionPm.resetToDefault();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user