-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
64 lines (56 loc) · 2.07 KB
/
app.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
const Discord = require("discord.js");
const config = require("./config.json");
const client = new Discord.Client();
forwards = {
"565664318062854145":"565665061192859649",
"565666777971818542":"564656640809500682",
"565667577003507732":"564663857524768797"
}
client.on("message", message => {
if(message.author.id == client.user.id) return;
if(forwards[message.channel.id]) {
client.channels.get(forwards[message.channel.id]).send(embedMessage(message, `**channel:** ${message.channel} | **user:** ${message.author}\n\n`))
.then(async (msg) => {
await msg.react('✅');
await msg.react('🛑');
msg.react('👀');
});
message.delete();
message.author.send("We have recived your support request. We will get back to you when we finish our review.");
}
});
client.on("messageReactionAdd", (reaction, user) => {
if(user.id == client.user.id) return;
if(reaction.message.embeds) {
let author = client.users.get(reaction.message.embeds[0].footer.text);
if(reaction.emoji == "✅") {
author.send(`${user.username} has accepted the following request!`);
author.send(new Discord.RichEmbed(reaction.message.embeds[0]));
}
else if(reaction.emoji == "🛑") {
author.send(`${user.username} has declined the following request!`);
author.send(new Discord.RichEmbed(reaction.message.embeds[0]));
}
else if(reaction.emoji == "👀") {
author.send(`${user.username} is looking into your request!`);
author.send(new Discord.RichEmbed(reaction.message.embeds[0]));
}
}
});
client.on('ready', () => {
client.user.setPresence({
game: {
name: 'Created by Creators Club! https://creatorsclub.net/'
}
});
});
client.login(config.token);
embedMessage = (message, description = "") => {
const embed = new Discord.RichEmbed()
embed.setTitle("Creators Club™ | Version 1.1");
embed.setDescription(description + message.content);
embed.setColor('#36393f');
embed.setAuthor(message.author.username, message.author.avatarURL);
embed.setFooter(message.author.id);
return embed;
}