mirror of
https://github.com/sern-handler/create-bot
synced 2026-06-28 02:32:21 +00:00
33 lines
889 B
JavaScript
33 lines
889 B
JavaScript
/// <reference path="dependencies.d.ts" />
|
|
import 'dotenv/config'
|
|
import * as config from './config.js'
|
|
import { Client, GatewayIntentBits } from 'discord.js';
|
|
import { Sern, makeDependencies } from '@sern/handler';
|
|
import { Publisher } from '@sern/publisher'
|
|
|
|
const client = new Client({
|
|
intents: [
|
|
GatewayIntentBits.Guilds,
|
|
GatewayIntentBits.GuildMembers,
|
|
GatewayIntentBits.GuildMessages,
|
|
GatewayIntentBits.MessageContent, // Make sure this is enabled for text commands!
|
|
],
|
|
});
|
|
|
|
/**
|
|
* Where all of your dependencies are composed.
|
|
* '@sern/client' is usually your Discord Client.
|
|
* Use this function to access all of your dependencies.
|
|
* This is used for external event modules as well
|
|
*/
|
|
await makeDependencies(({ add }) => {
|
|
add('@sern/client', client);
|
|
|
|
add('publisher', new Publisher());
|
|
});
|
|
|
|
//View docs for all options
|
|
Sern.init(config);
|
|
|
|
client.login();
|