Készítő: Botched Prairie Dog, 4 éve frissítve, szöveg nyelve: Plain Text.
Beágyazás:
  1. import DiscordJS, { Intents } from 'discord.js'
  2. import WOKCommands from 'wokcommands'
  3. import path from 'path'
  4. import dotenv from 'dotenv'
  5. import mongoose from 'mongoose'
  6. import 'dotenv/config'
  7. import schema from './schema'
  8.  
  9.  
  10. const client = new DiscordJS.Client({
  11.     intents: [
  12.         Intents.FLAGS.GUILDS,
  13.         Intents.FLAGS.GUILD_MESSAGES,
  14.         Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
  15.     ],
  16. })
  17.  
  18. client.on('ready', async () => {
  19.     await mongoose.connect(
  20.         process.env.MONGO_URI || ' ',
  21.         {
  22.             keepAlive: true
  23.         }
  24.     )
  25.  
  26.     new WOKCommands(client, {
  27.         commandsDir: path.join(__dirname, 'commands'),
  28.         typeScript: true,
  29.         testServers: ['862320682973265940'],
  30.         botOwners: ['695645133093470209'],
  31.     })
  32. })
  33.  
  34. client.login(process.env.TOKEN)
  35.