This repository has been archived by the owner on Aug 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdiscordTogether.js
86 lines (82 loc) · 3.81 KB
/
discordTogether.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
const Discord = require('discord.js');
const client = new Discord.Client({ intents: [Discord.Intents.FLAGS.GUILDS, Discord.Intents.FLAGS.GUILD_MESSAGES] });
const { token, prefix } = require("./config.json");
const { DiscordTogether } = require('discord-together');
client.discordTogether = new DiscordTogether(client);
client.on('messageCreate', async message => {
if (!message.content.startsWith(prefix) || message.author.bot) return;
if (message.content === prefix + "activity") {
message.channel.send('**Activities:** youtube, youtubedev, poker, betrayal, fishing, chess, chessdev, lettertile, wordsnack, doodle crew');
};
if (message.content === prefix + "activity youtube") {
if (message.member.voice.channel) {
client.discordTogether.createTogetherCode(message.member.voice.channel.id, 'youtube').then(async invite => {
return message.channel.send(`${invite.code}`);
});
};
};
if (message.content === prefix + "activity youtubedev") {
if (message.member.voice.channel) {
client.discordTogether.createTogetherCode(message.member.voice.channel.id, 'youtubeDev').then(async invite => {
return message.channel.send(`${invite.code}`);
});
};
};
if (message.content === prefix + "activity poker") {
if (message.member.voice.channel) {
client.discordTogether.createTogetherCode(message.member.voice.channel.id, 'poker').then(async invite => {
return message.channel.send(`${invite.code}`);
});
};
};
if (message.content === prefix + "activity betrayal") {
if (message.member.voice.channel) {
client.discordTogether.createTogetherCode(message.member.voice.channel.id, 'betrayal').then(async invite => {
return message.channel.send(`${invite.code}`);
});
};
};
if (message.content === prefix + "activity fishing") {
if (message.member.voice.channel) {
client.discordTogether.createTogetherCode(message.member.voice.channel.id, 'fishing').then(async invite => {
return message.channel.send(`${invite.code}`);
});
};
};
if (message.content === prefix + "activity chess") {
if (message.member.voice.channel) {
client.discordTogether.createTogetherCode(message.member.voice.channel.id, 'chess').then(async invite => {
return message.channel.send(`${invite.code}`);
});
};
};
if (message.content === prefix + "activity chessdev") {
if (message.member.voice.channel) {
client.discordTogether.createTogetherCode(message.member.voice.channel.id, 'chessDev').then(async invite => {
return message.channel.send(`${invite.code}`);
});
};
};
if (message.content === prefix + "activity lettertile") {
if (message.member.voice.channel) {
client.discordTogether.createTogetherCode(message.member.voice.channel.id, 'lettertile').then(async invite => {
return message.channel.send(`${invite.code}`);
});
};
};
if (message.content === prefix + "activity wordsnack") {
if (message.member.voice.channel) {
client.discordTogether.createTogetherCode(message.member.voice.channel.id, 'wordsnack').then(async invite => {
return message.channel.send(`${invite.code}`);
});
};
};
if (message.content === prefix + "activity doodlecrew") {
if (message.member.voice.channel) {
client.discordTogether.createTogetherCode(message.member.voice.channel.id, 'doodlecrew').then(async invite => {
return message.channel.send(`${invite.code}`);
});
};
};
});
client.login(token);