-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot.ts
33 lines (29 loc) · 888 Bytes
/
bot.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import dotenv from 'dotenv';
import { Intents } from 'discord.js';
import { SapphireClient } from '@sapphire/framework';
import '@sapphire/plugin-logger/register';
import '@sapphire/plugin-i18next/register';
dotenv.config();
const client = new SapphireClient({
defaultPrefix: 'pd!',
loadMessageCommandListeners: true,
loadDefaultErrorListeners: false,
typing: true,
i18n: {
fetchLanguage: _ => 'en-US'
},
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.DIRECT_MESSAGES,
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.GUILD_VOICE_STATES]
});
if (process.env.SH_TOKEN == '' || process.env.SH_TOKEN == undefined) {
client.login(process.env.DJS_TOKEN);
} else {
client.login(process.env.SH_TOKEN);
}
client.on('ready', () => {
client.logger.info('Bot started');
client.user!.setActivity('Type pd!help');
});