Shadowblade911 / MrLancer-v2

ISC License
0 stars 0 forks source link

Automatically register guilds instead of requiring /register #11

Closed jcotton42 closed 2 years ago

jcotton42 commented 2 years ago

Sifting through the discord.js docs there's a guildCreate event fired whenever the bot joins a server which could be used to perform the registration step automatically https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=e-guildCreate.

From Discord's docs it looks like you'll need to add the GUILDS gateway intent to receive this event https://discord.com/developers/docs/topics/gateway#list-of-intents.

It's not clear whether this event is only fired once when the bot is invited, or every time it starts up, so the error that arises from inserting a duplicate guild will need to be handled.