mirror of
https://github.com/ahmadk953/poixpixel-discord-bot.git
synced 2025-05-10 18:53:05 +00:00
Added Basic Redis Caching for DB Queries
This commit is contained in:
parent
e1003ee214
commit
0d04adf4fd
8 changed files with 386 additions and 58 deletions
|
@ -1,9 +1,19 @@
|
|||
import { Client, Events } from 'discord.js';
|
||||
|
||||
import { setMembers } from '../db/db.js';
|
||||
import { loadConfig } from '../util/configLoader.js';
|
||||
|
||||
export default {
|
||||
name: Events.ClientReady,
|
||||
once: true,
|
||||
execute: async (client: Client) => {
|
||||
const config = loadConfig();
|
||||
const members = await client.guilds.cache
|
||||
.find((guild) => guild.id === config.guildId)
|
||||
?.members.fetch();
|
||||
const nonBotMembers = members!.filter((m) => !m.user.bot);
|
||||
await setMembers(nonBotMembers);
|
||||
|
||||
console.log(`Ready! Logged in as ${client.user?.tag}`);
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue