Skip to content
This repository was archived by the owner on May 24, 2021. It is now read-only.

Commit 45f2b15

Browse files
committed
guildCreate is important
1 parent d0dee8f commit 45f2b15

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

wikilinker.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ bot.once('ready', () => {
2525
}).catch(console.error);
2626
});
2727

28+
bot.on('guildCreate', guild => {
29+
if (!db.hasOwnProperty(guild.id)) db[guild.id] = {};
30+
guild.settings = db[guild.id];
31+
saveDB().then(() => {
32+
console.log(`New Guild: ${guild.name}`);
33+
}).catch(console.error);
34+
});
35+
2836
bot.on('message', (msg) => {
2937
if (msg.author.bot || !msg.guild || !trulyReady) return;
3038

0 commit comments

Comments
 (0)