Compare commits
2 Commits
b51300d878
...
aac86d5d71
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aac86d5d71 | ||
|
|
a7d1f4e6b4 |
@@ -32,10 +32,15 @@ export async function autocomplete(nodeIo, interaction) {
|
|||||||
|
|
||||||
log.DEBUG(focusedValue, choices, filtered);
|
log.DEBUG(focusedValue, choices, filtered);
|
||||||
|
|
||||||
|
try {
|
||||||
await interaction.respond(
|
await interaction.respond(
|
||||||
filtered.map(choice => ({ name: choice.name, value: choice.name }))
|
filtered.map(choice => ({ name: choice.name, value: choice.name }))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
catch (e) {
|
||||||
|
log.WARN("Autocomplete interaction failure", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle join command execution
|
* Handle join command execution
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ dotenv.config();
|
|||||||
import { Events } from 'discord.js';
|
import { Events } from 'discord.js';
|
||||||
import { gptHandler } from "../modules/gptHandler.mjs";
|
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;
|
export const name = Events.GuildMemberAdd;
|
||||||
|
|
||||||
@@ -13,8 +13,8 @@ export async function execute(nodeIo, member) {
|
|||||||
log.INFO("New user joined the server", member);
|
log.INFO("New user joined the server", member);
|
||||||
let conversation = [];
|
let conversation = [];
|
||||||
conversation.push({
|
conversation.push({
|
||||||
role: 'system',
|
role: 'assistant',
|
||||||
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.`
|
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);
|
const response = await gptHandler(conversation);
|
||||||
|
|||||||
Reference in New Issue
Block a user