We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e81a74e commit 0f8d354Copy full SHA for 0f8d354
1 file changed
‎src/events/ready.ts‎
@@ -1,12 +1,20 @@
1
import { Events } from 'discord.js';
2
+import { config } from '../env.js';
3
+import { fetchAndCachePublicChannelsMessages } from '../util/cache.js';
4
import { createEvent } from '../util/events.js';
5
6
export const readyEvent = createEvent(
7
{
8
name: Events.ClientReady,
9
once: true,
10
},
- (client) => {
11
+ async (client) => {
12
console.log(`Ready! Logged in as ${client.user.tag}`);
13
+ if (config.fetchAndSyncMessages) {
14
+ const guild = client.guilds.cache.get(config.serverId);
15
+ if (guild) {
16
+ await fetchAndCachePublicChannelsMessages(guild, true);
17
+ }
18
19
}
20
);
0 commit comments