@HazTheWaz/

PwnBot

Nodejs

Stolen from kognise's github, because he gave us the creds for his Honeypot instead of letting us update his thing >:3

fork
loading
Files
  • index.js
  • 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
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
const Discord = require('discord.js')
const client = new Discord.Client()
const prefix = ';;'

const loaded = {
  guild: null,
    roles: {
        super: null,
            wandering: null,
                verified: null
                  },
                    channels: {
                        info: null,
                            countdown: null,
                                lobby: null,
                                    roles: null,
                                        challenges: null,
                                            rules: null
                                              },
                                                emojis: {
                                                    no: null,
                                                        yes: null
                                                          },
                                                            members: {
                                                                ctfbot: null
                                                                  }
                                                                  }
                                                                  const welcomeEmojis = [ '😝', '🍻', '😄', '🎉', '👍' ]

                                                                  const welcome = async (member) => {
                                                                    await loaded.channels.lobby.send(`
                                                                    ${member} welcome to PwnSquad! Make sure to read the ${loaded.channels.rules} and get some cool ${loaded.channels.roles}.

                                                                    If you're interested:
                                                                    - We have some fun challenges going on in ${loaded.channels.challenges}
                                                                    - If you're into CTFs check out ${loaded.members.ctfbot}
                                                                      `.trim())
                                                                        await loaded.channels.lobby.send(welcomeEmojis[Math.floor(Math.random() * welcomeEmojis.length)])
                                                                        }

                                                                        client.on('ready', async () => {
                                                                          console.log(`> Logged in as ${client.user.tag}`)
                                                                            client.user.setActivity('unverified members', { type: 'WATCHING' })

                                                                              loaded.guild = client.guilds.get('520444262685474816')

                                                                                loaded.roles.super = loaded.guild.roles.get('593311176117714944')
                                                                                  loaded.roles.wandering = loaded.guild.roles.get('563143582765023232')
                                                                                    loaded.roles.verified = loaded.guild.roles.get('520461398183247875')

                                                                                      loaded.channels.info = loaded.guild.channels.get('559771387766505472')
                                                                                        loaded.channels.countdown = loaded.guild.channels.get('572967189053702163')
                                                                                          loaded.channels.lobby = loaded.guild.channels.get('520452924967747584')
                                                                                            loaded.channels.roles = loaded.guild.channels.get('520466535198752778')
                                                                                              loaded.channels.challenges = loaded.guild.channels.get('585583470626078720')
                                                                                                loaded.channels.rules = loaded.guild.channels.get('540370552200757248')

                                                                                                  loaded.emojis.no = loaded.guild.emojis.get('540601942385229834')
                                                                                                    loaded.emojis.yes = loaded.guild.emojis.get('540601942217457674')

                                                                                                      loaded.members.ctfbot = loaded.guild.members.get('580257069760905216')

                                                                                                      client.on('message', async (message) => {

                                                                                                        if (!message.content.startsWith(prefix)) return
                                                                                                          if (!message.member.roles.get(loaded.roles.super.id)) return

                                                                                                            const members = message.mentions.members

                                                                                                              if (message.content.startsWith(`${prefix}verify`)) {
                                                                                                                  if (members.size < 1) {
                                                                                                                        await message.channel.send(`${loaded.emojis.no} You must specify a member to verify!`)
                                                                                                                              return
                                                                                                                                  }

                                                                                                                                      for (let [ _, member ] of members) {
                                                                                                                                            if (member.roles.get(loaded.roles.verified.id)) {
                                                                                                                                                    await message.channel.send(`${loaded.emojis.no} ${member} is already verified!`)
                                                                                                                                                          } else {
                                                                                                                                                                  await member.removeRole(loaded.roles.wandering)
                                                                                                                                                                          await member.addRole(loaded.roles.verified)
                                                                                                                                                                                  await message.channel.send(`${loaded.emojis.yes} ${member} has been verified.`)
                                                                                                                                                                                          await welcome(member)
                                                                                                                                                                                                }
                                                                                                                                                                                                    }
                                                                                                                                                                                                      } else if (message.content.startsWith(`${prefix}reject`)) {
                                                                                                                                                                                                          if (members.size < 1) {
                                                                                                                                                                                                                await message.channel.send(`${loaded.emojis.no} You must specify a member to reject!`)
                                                                                                                                                                                                                      return
                                                                                                                                                                                                                          }

                                                                                                                                                                                                                              for (let [ _, member ] of members) {
                                                                                                                                                                                                                                    if (member.roles.get(loaded.roles.verified.id)) {
                                                                                                                                                                                                                                            await message.channel.send(`${loaded.emojis.no} ${member} is verified, so you can't reject them! You may want to kick them instead.`)
                                                                                                                                                                                                                                                  } else {
                                                                                                                                                                                                                                                          try {
                                                                                                                                                                                                                                                                    await member.send('Sorry, but your application has been rejected. If you think you can do better fill out the form again. ')
                                                                                                                                                                                                                                                                            } catch(error) {
                                                                                                                                                                                                                                                                                      console.log(`> Couldn't send a DM to ${member.displayName}`)
                                                                                                                                                                                                                                                                                              }
                                                                                                                                                                                                                                                                                                      await member.kick()
                                                                                                                                                                                                                                                                                                              await message.channel.send(`${loaded.emojis.yes} ${member} has been rejected.`)
                                                                                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                                                                                        }
                                                                                                                                                                                                                                                                                                                          }
                                                                                                                                                                                                                                                                                                                          })

                                                                                                                                                                                                                                                                                                                          client.login(process.env.TOKEN)
                                                                                                                                                                                                                                                                                                                          
node v10.16.0