forked from Biack1st/Super-Bot-9000-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCommandsList.js
237 lines (193 loc) · 6.77 KB
/
CommandsList.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
const prefix = ">"
const Roulettemodule = require("./commands/roulette")
const discord = require("discord.js")
const robotIcon = "https://i.imgur.com/ufhQdix.png"
const list = [
{
cmd: prefix + `spamping`,
action: function(msg){
const blacklisted = [759136939889655820]
const repeatTime = 35
const arg2 = msg.content.split(" ")[1]
let replied = arg2
for (let i = 0; i < repeatTime; i++) {
replied += arg2
}
if (msg.author.id != 759136939889655820) {
msg.reply(replied)
}
else {
msg.reply("you are blacklisted from using this command")
}
},
description: "Spam pings the following user."
},
{
cmd: prefix + "funfact",
action: async function(msg) {
try {
const getFunFact = require("./commands/funFact")
const data = await getFunFact()
console.log(data)
msg.reply({embeds: [{
color: 0x0099ff,
title: 'Fun fact',
author: {
name: 'Super Robot 9000',
icon_url: 'https://images-ext-1.discordapp.net/external/j0GYtDP6M3F6iKBkAeLUcVPwHcmA5V-u4nmz3MNTg10/https/i.imgur.com/ufhQdix.png',
},
description: 'Fun fact',
fields: [
{
name: ":warning: WARNING :warning:",
value: "The following fact is returned by 3rd party API endpoint. The following fact may be inappropriate or gross for some users."
},
{
name: "Fact",
value: data.data
},
],
footer: {
text: `Called on by: ${msg.author.tag}`,
icon_url: 'https://images-ext-1.discordapp.net/external/j0GYtDP6M3F6iKBkAeLUcVPwHcmA5V-u4nmz3MNTg10/https/i.imgur.com/ufhQdix.png',
},
}]
})
console.log("replied")
}
catch(err) {
msg.reply("Failed to get a fun fact :(")
console.log(err)
}
},
description: "Replies with a random, useless fact."
},
{
cmd: prefix + `roulette`,
action: function(msg, client){
const randomchance = Roulettemodule(1,2)
const userMsg = randomchance == 1 && "you win" || "you lose"
const embedData = {
color: 0x0099ff,
title: 'Roulette',
author: {
name: 'Super bot 9000',
icon_url: 'https://i.imgur.com/ufhQdix.png',
},
description: 'Roulette',
thumbnail: {
url: 'https://i.imgur.com/h1Al3kp.png',
},
fields: [
{
name: 'Result',
value: userMsg,
},
],
timestamp: new Date(),
footer: {
text: `called on by ${msg.author.tag}`,
icon_url: 'https://i.imgur.com/ufhQdix.png',
},
}
msg.reply({ embeds: [embedData] })
},
description: "Plays a game of Roulette"
},
{
cmd: prefix + "help",
action: function(msg) {
const feilds = []
for (let i = 0; i < list.length; i++) {
const cmd = list[i]
feilds.push({name: cmd.cmd,
value: cmd.description || "*no description given*"})
}
const embedData = {
color: 0x0099ff,
author: {
name: "Super bot 9000",
icon_url: "https://images-ext-1.discordapp.net/external/j0GYtDP6M3F6iKBkAeLUcVPwHcmA5V-u4nmz3MNTg10/https/i.imgur.com/ufhQdix.png"
},
fields: feilds
}
msg.reply({embeds: [embedData]})
}
},
{
cmd: prefix + "devforumstats",
action: async function(msg) {
const getData = require("./commands/DevforumStats")
const getLatestPost = require("./commands/latestPost")
const target = msg.content.split(" ")[1]
if (target) {
const data = await getData(target)
if (! data["error_type"]) {
const correctUsername = data.users[0].name
let latestPost = await getLatestPost(target)
const latestPosturl = `https://devforum.roblox.com/t/${latestPost.topic_id}/${latestPost.post_number}`
latestPost = latestPost.excerpt.replace(/(<([^>]+)>)/gi, "")
let profilePic = "https://devforum.roblox.com" + data.users[0].avatar_template
const split = profilePic.split("{size}")
profilePic = `${split[0]}512${split[1]}`
const userSummary = data["user_summary"]
const embedData = {
color: 0x1c55a7,
title: `${correctUsername}'s Stats`,
author: {
name: 'Super Robot 9000',
icon_url: robotIcon,
},
thumbnail: {
url: profilePic,
},
fields: [
{
name: "Days Visited: ",
value: `${userSummary.days_visited} days`
},
{
name: "Hearts Received",
value: `${userSummary.likes_received}`,
inline: true
},
{
name: "Hearts Given",
value: `${userSummary.likes_given}`,
inline: true
},
{
name: "Total Posts",
value: `${userSummary.post_count} Posts`,
inline: true
},
{
name: "Latest Post",
value: `${latestPost.length > 1024 && latestPost.substring(0, 1021) + "..." || latestPost}`,
inline: true
},
{
name: "Latest Post URL",
value: `${latestPosturl}`,
inline: false
}
],
footer: {
text: `Called on by: ${msg.author.tag}`,
icon_url: robotIcon
}
}
msg.reply({embeds: [embedData]})
}
else {
msg.reply("Invalid user.")
}
}
else {
msg.reply("User is required.")
}
},
description: "Gets stats of the specified devforum user."
}
]
module.exports = list