This repository has been archived by the owner on Oct 31, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Len.js
49 lines (42 loc) · 1.38 KB
/
Len.js
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
require('dotenv').config();
const { LEN_TOKEN, OWNERS, LEN_PREFIX, INVITE, LEN_MUSIC_DIRECTORY } = process.env;
const path = require('path');
const Client = require('./structures/Client');
const client = new Client({
commandPrefix: LEN_PREFIX,
owner: OWNERS.split(','),
invite: INVITE,
disableEveryone: true,
unknownCommandResponse: false,
disabledEvents: ['TYPING_START']
});
client.registry
.registerDefaultTypes()
.registerTypesIn(path.join(__dirname, 'types'))
.registerGroups([
['util', 'Utility'],
['info', 'Song Information'],
['controls', 'Music Controls'],
['other', 'Other']
])
.registerDefaultCommands({
help: false,
ping: false,
prefix: false,
commandState: false
})
.registerCommandsIn(path.join(__dirname, 'commands'));
client.on('ready', async () => {
client.logger.info(`[READY] Logged in as ${client.user.tag}! ID: ${client.user.id}`);
await client.jukebox.registerSongs(LEN_MUSIC_DIRECTORY);
const connection = await client.jukebox.channel.join();
client.jukebox.play(connection);
});
client.on('disconnect', event => {
client.logger.error(`[DISCONNECT] Disconnected with code ${event.code}.`);
process.exit(0);
});
client.on('error', err => client.logger.error(err));
client.on('warn', warn => client.logger.warn(warn));
client.on('commandError', (command, err) => client.logger.error(`[COMMAND:${command.name}]\n${err.stack}`));
client.login(LEN_TOKEN);