Compare commits
2 Commits
697025ec1e
...
24296c2ae4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
24296c2ae4 | ||
|
|
db065c3ef0 |
16
discordBot/events/guildCreate.mjs
Normal file
16
discordBot/events/guildCreate.mjs
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import { DebugBuilder } from "../../modules/debugger.mjs";
|
||||||
|
const log = new DebugBuilder("server", "discordBot.events.guildCreate");
|
||||||
|
import { Events } from 'discord.js';
|
||||||
|
import { addEnabledCommands, addEnabledEventListeners } from "../discordBot.mjs";
|
||||||
|
|
||||||
|
export const name = Events.GuildMemberAdd;
|
||||||
|
|
||||||
|
export async function execute(nodeIo, guild) {
|
||||||
|
log.INFO("Bot has joined a new server", guild);
|
||||||
|
|
||||||
|
log.DEBUG("Refreshing commands enabled");
|
||||||
|
await addEnabledCommands(nodeIo.serverClient);
|
||||||
|
|
||||||
|
log.DEBUG("Refreshing events enabled");
|
||||||
|
await addEnabledEventListeners(nodeIo.serverClient);
|
||||||
|
}
|
||||||
@@ -14,7 +14,7 @@ export async function execute(nodeIo, member) {
|
|||||||
let conversation = [];
|
let conversation = [];
|
||||||
conversation.push({
|
conversation.push({
|
||||||
role: 'system',
|
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.`
|
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.`
|
||||||
})
|
})
|
||||||
|
|
||||||
const response = await gptHandler(conversation);
|
const response = await gptHandler(conversation);
|
||||||
|
|||||||
Reference in New Issue
Block a user