@HazTheWaz/

Thanos

Nodejs

No description

fork
loading
Files
  • index.js
  • package-lock.json
  • server.js
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
let discord = require('discord.js');
let keepAlive = require('./server.js');
let bot = new discord.Client();
let prefix = "t!"
let embedColor = eval('('+0xa900a9+')');

function snap(){
  let list = new Set();
  let memlist = guild.members.filter(member => !member.user.bot).size
  let snaplist = memlist.size/2

  if (list.size != snaplist) {
    list.add(message.guild.members.random())
    console.log(list)
  } else if (list.size = snaplist) {
    bot.kick(message.guild.members in list)
    console.log(list)
  }
}

bot.on('ready', () => {
  console.log('Logged in as ' + bot.user.tag);
});

bot.on('message', msg => {
 if (msg.content === prefix + 'info') {
   if (msg.author.bot) return;
   msg.channel.send({embed: {
      tilte: `Information:`,
      color: embedColor,
      fields: [{
          name: "Created by",
          value: "Haziallat"
      }, {
          name: "Thanks to",
          value: "LordPoseidon"
      }]
    }
  });
  return;
 } else if (msg.content === prefix + 'snap') {
   if (msg.author.bot) return;
   if (msg.member.hasPermission("KICK_MEMBERS")) {
      msg.channel.send("Should've gone for the head.")
      snap;
      return;
   } else {
     msg.channel.send("The hardest choices require the strongest wills. (You don't have permissions to kick members.)")
     return;
   }
   return;
 } else {
   return;
 }
});

keepAlive();
bot.login(process.env.token);
node v10.16.0