Compare commits

..

2 Commits

Author SHA1 Message Date
Logan Cusano
aac86d5d71 Update new guildmember action
All checks were successful
release-tag / release-image (push) Successful in 2m30s
DRB Tests / drb_mocha_tests (push) Successful in 28s
2024-08-04 16:02:49 -04:00
Logan Cusano
a7d1f4e6b4 Handle join auto complete error and update formatting 2024-08-04 16:01:59 -04:00
2 changed files with 14 additions and 9 deletions

View File

@@ -32,9 +32,14 @@ export async function autocomplete(nodeIo, interaction) {
log.DEBUG(focusedValue, choices, filtered);
try {
await interaction.respond(
filtered.map(choice => ({ name: choice.name, value: choice.name }))
);
}
catch (e) {
log.WARN("Autocomplete interaction failure", e);
}
}
/**

View File

@@ -5,7 +5,7 @@ dotenv.config();
import { Events } from 'discord.js';
import { gptHandler } from "../modules/gptHandler.mjs";
const welcomeChannel = process.env.WELCOME_CHANNEL_ID;
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
export const name = Events.GuildMemberAdd;
@@ -13,8 +13,8 @@ export async function execute(nodeIo, member) {
log.INFO("New user joined the server", member);
let conversation = [];
conversation.push({
role: 'system',
content: `There has been a new user that joined. Their name is '<@${member.id}>'. Please welcome them to the server and remind them about the rules.`
role: 'assistant',
content: `A new user has joined the server. Their name is '<@${member.id}>'. Please welcome them to the server and remind them about the rules.`
})
const response = await gptHandler(conversation);