-
Notifications
You must be signed in to change notification settings - Fork 2
/
eksiilsus.js
41 lines (34 loc) · 1.09 KB
/
eksiilsus.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
const { Client, GatewayIntentBits } = require('discord.js');
const { playRadio } = require('./radio');
const { playYouTube, skipSong } = require('./yt');
const { playSpotify } = require('./spotify');
require('dotenv').config();
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.MessageContent,
],
});
const prefix = process.env.PREFIX;
const token = process.env.TOKEN;
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.on('messageCreate', async (message) => {
if (message.author.bot) return;
if (!message.content.startsWith(prefix)) return;
const args = message.content.toLowerCase().slice(prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase();
if (command === 'raadio') {
playRadio(message, args);
} else if (command === 'yt') {
playYouTube(message, args);
} else if (command === 'spotify') {
playSpotify(message, args);
} else if (command === 'skip'){
skipSong();
}
});
client.login(token);