@_RealUnderscor/

AngelicStridentExtensions

Nodejs

My Discord server bot. Using Discord.JS.

fork
loading
Files
  • index.js
  • package-lock.json
  • package.json
index.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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
const Discord = require('discord.js');
const client = new Discord.Client();
const bot = 

client.on('ready', () => {
  console.log(`Logged in as ${client.user.tag}!`);
});

client.on('guildMemberAdd' ,(message, member) => {
    message.author.send(`\`\`Welcome to MHGames! Thanks for joining us, and enjoy your stay!\`\`\n**Use =help for command help. Thank you!**`)
});

client.on('ready', () => {
  client.user.setActivity(`=help | MHGames`)
})


client.on('message', message => {
/*
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
= Automatic Bugs Log
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
*/
  var responds = {
    bugs: function() { 
      message.channel.send("Okay, we will look into it. Messaging the owner and other staff...")
      setTimeout(function() {
        message.delete(1)

        client.channels.get(`572904287328534560`).send(`New bug report:\n\n**${message.content}**\n\nBy ${message.author}\n\nTo <@&560934793039314994> `)

        client.users.get(`506219124020609045`).send(`New bug report:\n\n**${message.content}**\n\nBy ${message.author}\n\nTo Staff 'n Stuff `)
      }, 100)
    }
  }
  if (message.channel.id == 557685905033527306) {
    if (message.author.id == 554779347374833665) {
      setTimeout(function() {
        message.delete(1)
      }, 5000)
      return
    }
    responds.bugs()
  }

/*
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
= Automatic Suggestions Log
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
*/

  var responding = {
    suggestions: function() { 
      message.channel.send("Okay, we will look into it. Messaging the owner and other staff...")
      setTimeout(function() {
        message.delete(1)

        client.channels.get(`572940645883314186`).send(`New suggestion:\n\n**${message.content}**\n\nBy ${message.author}\n\nTo <@&560934793039314994> `)

        client.users.get(`506219124020609045`).send(`New suggestion:\n\n**${message.content}**\n\nBy ${message.author}\n\nTo Staff 'n Stuff `)
      }, 100)
    }
  }
  if (message.channel.id == 557685783658758164) {
    if (message.author.id == 554779347374833665) {
      setTimeout(function() {
        message.delete(1)
      }, 5000)
      return
    }
    responding.suggestions()
  }

  var help = {
    helps: function() {
      if(message.content == "=help") {
        message.channel.send("**Commands:**\n\n``=help``\n**Shows this message.**\n\n``=bal (=currency, =balance, =money, =mon - aliases)``\n**Shows your Discord credits.**\n\n``=mcbal (=mccurrency, =mcbalance, =mcmoney, =mcmon - aliases)``")
      }
    }
  }
  help.helps()

})
  

client.on('message', message => {
  function getRandomResp(max) {
    return Math.floor(Math.random() * Math.floor(max));
  }
  
  var respond = {
    respondToPlayer: function() {
      if(message.content.toLowerCase() == this.themessage) {
        if(getRandomResp(2) == "0") {
          message.channel.send("Hey there!");
        }

        if(getRandomResp(2) == "1") {
          message.channel.send("Hello there!");
        }
      }
    }
  }

  var message1 = {
    themessage: "hello bot"
  }

  var message2 = {
    themessage: "hey bot"
  }
  
  var message3 = {
    themessage: "hello bot!"
  }

  var message4 = {
    themessage: "hey bot!"
  }

  respond.respondToPlayer.call(message1)
  respond.respondToPlayer.call(message2)
});


client.on('message', message => {
  
  var respond1 = {
    denyPlayer: function() {
      if(message.content.toLowerCase() == this.dthemessage) {
        message.channel.send("Let me think about it...")
        setTimeout(function() {
          message.channel.send("No.")
        }, 2000);
      }
    }
  }


  var dmessage1 = {
    dthemessage: "can i be owner"
  }

  var dmessage2 = {
    dthemessage: "can i be op"
  }

  var dmessage3 = {
    dthemessage: "can i be staff"
  }

  var dmessage4 = {
    dthemessage: "can i have owner"
  }

  var dmessage5 = {
    dthemessage: "can i have op"
  }

  var dmessage6 = {
    dthemessage: "can i have staff"
  }

  var dmessage7 = {
    dthemessage: "can i be owner?"
  }

  var dmessage8 = {
    dthemessage: "can i be op?"
  }

  var dmessage9 = {
    dthemessage: "can i be staff?"
  }

  var dmessage10 = {
    dthemessage: "can i have owner?"
  }

  var dmessage11 = {
    dthemessage: "can i have op?"
  }

  var dmessage12 = {
    dthemessage: "can i have staff?"
  }

  respond1.denyPlayer.call(dmessage1)

  respond1.denyPlayer.call(dmessage2)

  respond1.denyPlayer.call(dmessage3)

  respond1.denyPlayer.call(dmessage4)

  respond1.denyPlayer.call(dmessage5)

  respond1.denyPlayer.call(dmessage6)

  respond1.denyPlayer.call(dmessage7)

  respond1.denyPlayer.call(dmessage8)

  respond1.denyPlayer.call(dmessage9)

  respond1.denyPlayer.call(dmessage10)

  respond1.denyPlayer.call(dmessage11)

  respond1.denyPlayer.call(dmessage12)
});

client.on('message', message => {
  
  var respond2 = {
    sayBoth: function() {
      if(message.content.toLowerCase() == this.bthemessage) {
        message.channel.send("Let me think about it...")
        setTimeout(function() {
          message.channel.send("Maybe, both?")
        }, 1500);
      }
    }
  }


  var bmessage1 = {
    bthemessage: "sicko oof or robamba"
  }

  var bmessage2 = {
    bthemessage: "sicko oof or ro-bamba"
  }

  var bmessage3 = {
    bthemessage: "sicko oof or robamba?"
  }

  var bmessage4 = {
    bthemessage: "sicko oof or ro-bamba?"
  }

  var bmessage5 = {
    bthemessage: "tseries or pewdiepie"
  }

  var bmessage6 = {
    bthemessage: "t-series or pewdiepie"
  }

  var bmessage7 = {
    bthemessage: "tseries or pewdiepie?"
  }

  var bmessage8 = {
    bthemessage: "t-series or pewdiepie?"
  }

  respond2.sayBoth.call(bmessage1)
  respond2.sayBoth.call(bmessage2)
  respond2.sayBoth.call(bmessage3)
  respond2.sayBoth.call(bmessage4)
  respond2.sayBoth.call(bmessage5)
  respond2.sayBoth.call(bmessage6)
  respond2.sayBoth.call(bmessage7)
  respond2.sayBoth.call(bmessage8)
});
client.login("NTU0Nzc5MzQ3Mzc0ODMzNjY1.D35oEw.dzclZ4ZNz5lp2FhzZl9rUuVJgN4");
node v10.16.0