Browse Source

Working commands register and role

Robert 3 months ago
parent
commit
b50f06329d
6 changed files with 599 additions and 0 deletions
  1. 90
    0
      commands.js
  2. 34
    0
      database.js
  3. 17
    0
      fancyLog.js
  4. 78
    0
      index.js
  5. 358
    0
      package-lock.json
  6. 22
    0
      package.json

+ 90
- 0
commands.js View File

@@ -0,0 +1,90 @@
1
+const db = require('./database');
2
+const debug = require('debug')('Bot:commands');
3
+const cmd = new Map();
4
+
5
+async function register(bot, args, message) {
6
+    let user = await db.getUser(message.guild.id, String(message.member.id));
7
+    if (user && user.roleID) {
8
+        message.channel.send(`${message.member} ばか~~、 Posiadasz juz role <@&${user.roleID}>!`);
9
+        return `User(${message.member.displayName}) already created role!`;
10
+    }
11
+    let role = await message.guild.roles.create({
12
+        data: {
13
+          name: '%'+message.member.displayName,
14
+          color: 'RANDOM',
15
+          position: 0
16
+        },
17
+        reason: 'Register command used.'
18
+      });
19
+    if(role && role.id) {
20
+        try {
21
+            message.member.roles.add(role);
22
+        } catch(err) { debug(err); throw err}
23
+        message.channel.send(`${message.author}, Your private role is ${role}`);
24
+        db.addUser(message.guild.id, String(message.member.id), String(role.id));
25
+    } else {message.channel.send(`${message.author}, Cos poszlo nie tak xD`);}
26
+    
27
+}
28
+cmd.set('register', register);
29
+async function role(bot, args, message) {
30
+    if (!args[0]) { return message.reply(`Usage of ...`); }
31
+    const nestedCommands = {
32
+      name: name,
33
+      color: color,
34
+      restore: restore,
35
+    };
36
+    if (!{}.hasOwnProperty.call(nestedCommands, args[0])) { return message.reply(`Usage of ...`); }
37
+    nestedCommands[args[0]](bot, args, message);
38
+
39
+    async function name(bot, args, message) {
40
+        const user = await db.getUser(message.guild.id, String(message.member.id));
41
+        if (!user) {
42
+            message.reply('You don\'t have private role!');
43
+            throw new Error(`${message.member.displayName}, don't have private role!`);
44
+        }
45
+        const role = await message.guild.roles.resolve(user.roleID);
46
+        const nestedCommands = {
47
+          get() {
48
+            return message.reply(`role name is ${role}.`);
49
+          },
50
+          set() {
51
+            const newName = args.slice(2, args.length).join(' ');
52
+            if (newName.length < 5) {
53
+              return message.reply('new role name is too short!');
54
+            }
55
+            role.setName("%" + newName)
56
+              .then(() => {
57
+                message.reply(`role name updated. ${role}`);
58
+              })
59
+              .catch(err => debug(err));
60
+          },
61
+        };
62
+        if (!{}.hasOwnProperty.call(nestedCommands, args[1])) { return message.reply(`Usage of ...`); }
63
+        nestedCommands[args[1]](message, args);
64
+    }
65
+    async function color(bot, args, message) {
66
+        const user = await db.getUser(message.guild.id, String(message.member.id));
67
+        if (!user) {
68
+            message.reply('You don\'t have private role!');
69
+            throw new Error(`${message.member.displayName}, don't have private role!`);
70
+        }
71
+        const role = await message.guild.roles.resolve(user.roleID);
72
+        const nestedCommands = {
73
+          get() {
74
+            return message.reply(`role color is ${role.hexColor}.`);
75
+          },
76
+          set() {
77
+            args[2] = args[2].toUpperCase();
78
+            message.guild.roles.resolve(user.roleID).setColor(args[2], 'Color change!');
79
+            message.reply(`Your new role color ${role}(${args[2]})`);
80
+          }
81
+        };
82
+        if (!{}.hasOwnProperty.call(nestedCommands, args[1])) { return message.reply(`Usage of ...`); }
83
+        nestedCommands[args[1]](message, args);
84
+    }
85
+    async function restore(bot, args, message) {
86
+        message.reply('Work in progress');
87
+    }
88
+}
89
+cmd.set('role', role);
90
+module.exports = cmd;

+ 34
- 0
database.js View File

@@ -0,0 +1,34 @@
1
+const debug = require('debug')('Bot:database');
2
+const mongoose = require('mongoose');
3
+
4
+debug(process.env.MONGODB)
5
+mongoose.connect(process.env.MONGODB, { useNewUrlParser: true }).catch(debug);
6
+const conn = mongoose.connection;
7
+
8
+conn.once('open', () => {
9
+  debug('connected');
10
+});
11
+
12
+conn.on('disconnect', () => {
13
+  mongoose.connect(process.env.MONGODB).catch(debug);
14
+});
15
+
16
+const userScheme = new mongoose.Schema({
17
+  userID: String, roleID: String, timestamp: String,
18
+});
19
+
20
+function getUser(serverID, userID) {
21
+  return mongoose.model(serverID, userScheme).findOne({ userID });
22
+}
23
+function addUser(serverID, userID, roleID) {
24
+  if (!serverID) throw new Error('serverID is undefined!');
25
+  if (!userID || !roleID) throw new Error(`${!userID ? 'userID' : 'roleID'} is undefined!`);
26
+  return mongoose.model(serverID, userScheme).create({
27
+    userID, roleID, timestamp: String(Date.now()),
28
+  });
29
+}
30
+
31
+module.exports = {
32
+  getUser,
33
+  addUser
34
+};

+ 17
- 0
fancyLog.js View File

@@ -0,0 +1,17 @@
1
+const m = require('moment'),
2
+      c = require('chalk');
3
+const l = {};
4
+
5
+l.log = s => {
6
+    let time = c.yellow(new m().format('HH:mm:ss'));
7
+    return console.log(`[${time}]`, s)
8
+};
9
+l.error = s => {
10
+    let time = c.red(new m().format('HH:mm:ss'));
11
+    return console.log(`[${time}]`, s)
12
+};
13
+l.info = s => {
14
+    let time = c.blue(new m().format('HH:mm:ss'));
15
+    return console.log(`[${time}]`, s)
16
+};
17
+module.exports = l;

+ 78
- 0
index.js View File

@@ -0,0 +1,78 @@
1
+require('dotenv').config();
2
+const   DJS = require('discord.js'),
3
+        fl  = require('./fancyLog'),
4
+        debug = require('debug')('Bot:index'),
5
+        commands = require('./commands');
6
+const options = {
7
+    debug: false
8
+}
9
+let B = new DJS.Client({
10
+    disabledEvents: [
11
+        // 'RESUMED',
12
+        //'GUILD_SYNC',
13
+        // 'GUILD_CREATE',
14
+        //'GUILD_DELETE',
15
+        //'GUILD_UPDATE',
16
+        // 'GUILD_MEMBER_ADD',
17
+        //'GUILD_MEMBER_REMOVE',
18
+        //'GUILD_MEMBER_UPDATE',
19
+        //'GUILD_MEMBERS_CHUNK',
20
+        //'GUILD_ROLE_CREATE',
21
+        //'GUILD_ROLE_DELETE',
22
+        //'GUILD_ROLE_UPDATE',
23
+        'GUILD_BAN_ADD',
24
+        'GUILD_BAN_REMOVE',
25
+        'CHANNEL_CREATE',
26
+        'CHANNEL_DELETE',
27
+        'CHANNEL_UPDATE',
28
+        'CHANNEL_PINS_UPDATE',
29
+        'MESSAGE_DELETE',
30
+        'MESSAGE_UPDATE',
31
+        'MESSAGE_DELETE_BULK',
32
+        'MESSAGE_REACTION_ADD',
33
+        'MESSAGE_REACTION_REMOVE',
34
+        'MESSAGE_REACTION_REMOVE_ALL',
35
+        'USER_UPDATE',
36
+        'USER_NOTE_UPDATE',
37
+        'USER_SETTINGS_UPDATE',
38
+        'PRESENCE_UPDATE',
39
+        // 'VOICE_STATE_UPDATE',
40
+        'TYPING_START',
41
+        // 'VOICE_SERVER_UPDATE',
42
+        'RELATIONSHIP_ADD',
43
+        'RELATIONSHIP_REMOVE',
44
+    ]
45
+})
46
+
47
+B.on('ready', _ => {
48
+    fl.info('Ready!');
49
+})
50
+.on('error', e => {
51
+    fl.error('Error form DiscordAPI, please starts bot with DEBUG=* or DEBUG=Bot:* to see errors!');
52
+    debug(e);
53
+})
54
+.on('disconnect', () => {process.exit(0)})
55
+.on('message', messageHandler)
56
+
57
+B.login(process.env.TOKEN);
58
+
59
+function messageHandler(message) {
60
+    if (message.guild.id != process.env.SERVER) { return 'Server ignored.'; }
61
+    if (message.author.id === B.user.id) { return 'Self Message'; }
62
+    if (message.author.bot) { return 'Another bot message, ignored.'; }
63
+    if (message.channel.type !== 'text') { return 'Non "TextChannel" message, ignored.'; }
64
+    if (!message.content.startsWith(process.env.PREFIX)) { return 'Message without prefix, ignored.'; }
65
+    debug(`Message: [${message.channel.name}] ${message.author.username}: ${message.content}`);
66
+
67
+    const args = message.content.split(' ');
68
+    const cmd = args.shift().split('/').join('');
69
+    if (commands.has(cmd)) {
70
+        const command = commands.get(cmd);
71
+        try {
72
+            command(B, args, message);
73
+        } catch (error) {
74
+            fl.error(`Error with command!, ${cmd}`);
75
+            debug(`${cmd}, ${error}`);
76
+        }
77
+    }
78
+}

+ 358
- 0
package-lock.json View File

@@ -0,0 +1,358 @@
1
+{
2
+  "name": "bbot2018",
3
+  "version": "1.0.0",
4
+  "lockfileVersion": 1,
5
+  "requires": true,
6
+  "dependencies": {
7
+    "@discordjs/uws": {
8
+      "version": "10.149.0",
9
+      "resolved": "https://registry.npmjs.org/@discordjs/uws/-/uws-10.149.0.tgz",
10
+      "integrity": "sha512-N1wjoAD2DOgzevqzyTOWTgyO2divX03JWNQx4JHm/jQ/BRzZNkhwVRO3RC5Guww+srdgs4Tw4gwrzlJrlOhq/Q=="
11
+    },
12
+    "ansi-styles": {
13
+      "version": "3.2.1",
14
+      "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
15
+      "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
16
+      "requires": {
17
+        "color-convert": "^1.9.0"
18
+      }
19
+    },
20
+    "async": {
21
+      "version": "2.6.1",
22
+      "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz",
23
+      "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==",
24
+      "requires": {
25
+        "lodash": "^4.17.10"
26
+      }
27
+    },
28
+    "async-limiter": {
29
+      "version": "1.0.0",
30
+      "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz",
31
+      "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg=="
32
+    },
33
+    "asynckit": {
34
+      "version": "0.4.0",
35
+      "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
36
+      "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
37
+    },
38
+    "bluebird": {
39
+      "version": "3.5.1",
40
+      "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz",
41
+      "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA=="
42
+    },
43
+    "bson": {
44
+      "version": "1.1.0",
45
+      "resolved": "https://registry.npmjs.org/bson/-/bson-1.1.0.tgz",
46
+      "integrity": "sha512-9Aeai9TacfNtWXOYarkFJRW2CWo+dRon+fuLZYJmvLV3+MiUp0bEI6IAZfXEIg7/Pl/7IWlLaDnhzTsD81etQA=="
47
+    },
48
+    "chalk": {
49
+      "version": "2.4.1",
50
+      "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz",
51
+      "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==",
52
+      "requires": {
53
+        "ansi-styles": "^3.2.1",
54
+        "escape-string-regexp": "^1.0.5",
55
+        "supports-color": "^5.3.0"
56
+      }
57
+    },
58
+    "color-convert": {
59
+      "version": "1.9.3",
60
+      "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
61
+      "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
62
+      "requires": {
63
+        "color-name": "1.1.3"
64
+      }
65
+    },
66
+    "color-name": {
67
+      "version": "1.1.3",
68
+      "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
69
+      "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
70
+    },
71
+    "combined-stream": {
72
+      "version": "1.0.6",
73
+      "resolved": "http://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz",
74
+      "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=",
75
+      "requires": {
76
+        "delayed-stream": "~1.0.0"
77
+      }
78
+    },
79
+    "debug": {
80
+      "version": "4.0.1",
81
+      "resolved": "https://registry.npmjs.org/debug/-/debug-4.0.1.tgz",
82
+      "integrity": "sha512-K23FHJ/Mt404FSlp6gSZCevIbTMLX0j3fmHhUEhQ3Wq0FMODW3+cUSoLdy1Gx4polAf4t/lphhmHH35BB8cLYw==",
83
+      "requires": {
84
+        "ms": "^2.1.1"
85
+      }
86
+    },
87
+    "delayed-stream": {
88
+      "version": "1.0.0",
89
+      "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
90
+      "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
91
+    },
92
+    "discord.js": {
93
+      "version": "git+https://github.com/discordjs/discord.js.git#e189c1b728d8fd2742acc4d807e7559e807814fd",
94
+      "from": "git+https://github.com/discordjs/discord.js.git",
95
+      "requires": {
96
+        "form-data": "^2.3.2",
97
+        "node-fetch": "^2.1.2",
98
+        "pako": "^1.0.0",
99
+        "prism-media": "github:amishshah/prism-media#1e336c9a20dd0928ef3bdc2075ab58d1521fb323",
100
+        "tweetnacl": "^1.0.0",
101
+        "ws": "^6.0.0"
102
+      }
103
+    },
104
+    "dotenv": {
105
+      "version": "6.0.0",
106
+      "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-6.0.0.tgz",
107
+      "integrity": "sha512-FlWbnhgjtwD+uNLUGHbMykMOYQaTivdHEmYwAKFjn6GKe/CqY0fNae93ZHTd20snh9ZLr8mTzIL9m0APQ1pjQg=="
108
+    },
109
+    "escape-string-regexp": {
110
+      "version": "1.0.5",
111
+      "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
112
+      "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
113
+    },
114
+    "form-data": {
115
+      "version": "2.3.2",
116
+      "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz",
117
+      "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=",
118
+      "requires": {
119
+        "asynckit": "^0.4.0",
120
+        "combined-stream": "1.0.6",
121
+        "mime-types": "^2.1.12"
122
+      }
123
+    },
124
+    "has-flag": {
125
+      "version": "3.0.0",
126
+      "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
127
+      "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0="
128
+    },
129
+    "kareem": {
130
+      "version": "2.3.0",
131
+      "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.3.0.tgz",
132
+      "integrity": "sha512-6hHxsp9e6zQU8nXsP+02HGWXwTkOEw6IROhF2ZA28cYbUk4eJ6QbtZvdqZOdD9YPKghG3apk5eOCvs+tLl3lRg=="
133
+    },
134
+    "lodash": {
135
+      "version": "4.17.11",
136
+      "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz",
137
+      "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg=="
138
+    },
139
+    "lodash.get": {
140
+      "version": "4.4.2",
141
+      "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz",
142
+      "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk="
143
+    },
144
+    "memory-pager": {
145
+      "version": "1.1.0",
146
+      "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.1.0.tgz",
147
+      "integrity": "sha512-Mf9OHV/Y7h6YWDxTzX/b4ZZ4oh9NSXblQL8dtPCOomOtZciEHxePR78+uHFLLlsk01A6jVHhHsQZZ/WcIPpnzg==",
148
+      "optional": true
149
+    },
150
+    "mime-db": {
151
+      "version": "1.36.0",
152
+      "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.36.0.tgz",
153
+      "integrity": "sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw=="
154
+    },
155
+    "mime-types": {
156
+      "version": "2.1.20",
157
+      "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.20.tgz",
158
+      "integrity": "sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A==",
159
+      "requires": {
160
+        "mime-db": "~1.36.0"
161
+      }
162
+    },
163
+    "moment": {
164
+      "version": "2.22.2",
165
+      "resolved": "https://registry.npmjs.org/moment/-/moment-2.22.2.tgz",
166
+      "integrity": "sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y="
167
+    },
168
+    "mongodb": {
169
+      "version": "3.1.6",
170
+      "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.1.6.tgz",
171
+      "integrity": "sha512-E5QJuXQoMlT7KyCYqNNMfAkhfQD79AT4F8Xd+6x37OX+8BL17GyXyWvfm6wuyx4wnzCCPoCSLeMeUN2S7dU9yw==",
172
+      "requires": {
173
+        "mongodb-core": "3.1.5",
174
+        "safe-buffer": "^5.1.2"
175
+      }
176
+    },
177
+    "mongodb-core": {
178
+      "version": "3.1.5",
179
+      "resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-3.1.5.tgz",
180
+      "integrity": "sha512-emT/tM4ZBinqd6RZok+EzDdtN4LjYJIckv71qQVOEFmvXgT5cperZegVmTgox/1cx4XQu6LJ5ZuIwipP/eKdQg==",
181
+      "requires": {
182
+        "bson": "^1.1.0",
183
+        "require_optional": "^1.0.1",
184
+        "safe-buffer": "^5.1.2",
185
+        "saslprep": "^1.0.0"
186
+      }
187
+    },
188
+    "mongoose": {
189
+      "version": "5.3.0",
190
+      "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.3.0.tgz",
191
+      "integrity": "sha512-flRnA3CBkngBSPg2v0eYKPPwduE448PmicUk15DCxNjY1FoFD241Ntfa97oyvRm0APfj7i2ppz9zuMbXOrZMzg==",
192
+      "requires": {
193
+        "async": "2.6.1",
194
+        "bson": "~1.0.5",
195
+        "kareem": "2.3.0",
196
+        "lodash.get": "4.4.2",
197
+        "mongodb": "3.1.6",
198
+        "mongodb-core": "3.1.5",
199
+        "mongoose-legacy-pluralize": "1.0.2",
200
+        "mpath": "0.5.1",
201
+        "mquery": "3.2.0",
202
+        "ms": "2.0.0",
203
+        "regexp-clone": "0.0.1",
204
+        "safe-buffer": "5.1.2",
205
+        "sliced": "1.0.1"
206
+      },
207
+      "dependencies": {
208
+        "bson": {
209
+          "version": "1.0.9",
210
+          "resolved": "https://registry.npmjs.org/bson/-/bson-1.0.9.tgz",
211
+          "integrity": "sha512-IQX9/h7WdMBIW/q/++tGd+emQr0XMdeZ6icnT/74Xk9fnabWn+gZgpE+9V+gujL3hhJOoNrnDVY7tWdzc7NUTg=="
212
+        },
213
+        "ms": {
214
+          "version": "2.0.0",
215
+          "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
216
+          "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
217
+        }
218
+      }
219
+    },
220
+    "mongoose-legacy-pluralize": {
221
+      "version": "1.0.2",
222
+      "resolved": "https://registry.npmjs.org/mongoose-legacy-pluralize/-/mongoose-legacy-pluralize-1.0.2.tgz",
223
+      "integrity": "sha512-Yo/7qQU4/EyIS8YDFSeenIvXxZN+ld7YdV9LqFVQJzTLye8unujAWPZ4NWKfFA+RNjh+wvTWKY9Z3E5XM6ZZiQ=="
224
+    },
225
+    "mpath": {
226
+      "version": "0.5.1",
227
+      "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.5.1.tgz",
228
+      "integrity": "sha512-H8OVQ+QEz82sch4wbODFOz+3YQ61FYz/z3eJ5pIdbMEaUzDqA268Wd+Vt4Paw9TJfvDgVKaayC0gBzMIw2jhsg=="
229
+    },
230
+    "mquery": {
231
+      "version": "3.2.0",
232
+      "resolved": "https://registry.npmjs.org/mquery/-/mquery-3.2.0.tgz",
233
+      "integrity": "sha512-qPJcdK/yqcbQiKoemAt62Y0BAc0fTEKo1IThodBD+O5meQRJT/2HSe5QpBNwaa4CjskoGrYWsEyjkqgiE0qjhg==",
234
+      "requires": {
235
+        "bluebird": "3.5.1",
236
+        "debug": "3.1.0",
237
+        "regexp-clone": "0.0.1",
238
+        "safe-buffer": "5.1.2",
239
+        "sliced": "1.0.1"
240
+      },
241
+      "dependencies": {
242
+        "debug": {
243
+          "version": "3.1.0",
244
+          "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
245
+          "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
246
+          "requires": {
247
+            "ms": "2.0.0"
248
+          }
249
+        },
250
+        "ms": {
251
+          "version": "2.0.0",
252
+          "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
253
+          "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
254
+        }
255
+      }
256
+    },
257
+    "ms": {
258
+      "version": "2.1.1",
259
+      "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
260
+      "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg=="
261
+    },
262
+    "node-fetch": {
263
+      "version": "2.2.0",
264
+      "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.2.0.tgz",
265
+      "integrity": "sha512-OayFWziIxiHY8bCUyLX6sTpDH8Jsbp4FfYd1j1f7vZyfgkcOnAyM4oQR16f8a0s7Gl/viMGRey8eScYk4V4EZA=="
266
+    },
267
+    "pako": {
268
+      "version": "1.0.6",
269
+      "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.6.tgz",
270
+      "integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg=="
271
+    },
272
+    "pidusage": {
273
+      "version": "2.0.17",
274
+      "resolved": "https://registry.npmjs.org/pidusage/-/pidusage-2.0.17.tgz",
275
+      "integrity": "sha512-N8X5v18rBmlBoArfS83vrnD0gIFyZkXEo7a5pAS2aT0i2OLVymFb2AzVg+v8l/QcXnE1JwZcaXR8daJcoJqtjw==",
276
+      "requires": {
277
+        "safe-buffer": "^5.1.2"
278
+      }
279
+    },
280
+    "prism-media": {
281
+      "version": "github:amishshah/prism-media#1e336c9a20dd0928ef3bdc2075ab58d1521fb323",
282
+      "from": "github:amishshah/prism-media"
283
+    },
284
+    "regexp-clone": {
285
+      "version": "0.0.1",
286
+      "resolved": "https://registry.npmjs.org/regexp-clone/-/regexp-clone-0.0.1.tgz",
287
+      "integrity": "sha1-p8LgmJH9vzj7sQ03b7cwA+aKxYk="
288
+    },
289
+    "require_optional": {
290
+      "version": "1.0.1",
291
+      "resolved": "https://registry.npmjs.org/require_optional/-/require_optional-1.0.1.tgz",
292
+      "integrity": "sha512-qhM/y57enGWHAe3v/NcwML6a3/vfESLe/sGM2dII+gEO0BpKRUkWZow/tyloNqJyN6kXSl3RyyM8Ll5D/sJP8g==",
293
+      "requires": {
294
+        "resolve-from": "^2.0.0",
295
+        "semver": "^5.1.0"
296
+      }
297
+    },
298
+    "resolve-from": {
299
+      "version": "2.0.0",
300
+      "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz",
301
+      "integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c="
302
+    },
303
+    "safe-buffer": {
304
+      "version": "5.1.2",
305
+      "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
306
+      "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
307
+    },
308
+    "saslprep": {
309
+      "version": "1.0.2",
310
+      "resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.2.tgz",
311
+      "integrity": "sha512-4cDsYuAjXssUSjxHKRe4DTZC0agDwsCqcMqtJAQPzC74nJ7LfAJflAtC1Zed5hMzEQKj82d3tuzqdGNRsLJ4Gw==",
312
+      "optional": true,
313
+      "requires": {
314
+        "sparse-bitfield": "^3.0.3"
315
+      }
316
+    },
317
+    "semver": {
318
+      "version": "5.5.1",
319
+      "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.1.tgz",
320
+      "integrity": "sha512-PqpAxfrEhlSUWge8dwIp4tZnQ25DIOthpiaHNIthsjEFQD6EvqUKUDM7L8O2rShkFccYo1VjJR0coWfNkCubRw=="
321
+    },
322
+    "sliced": {
323
+      "version": "1.0.1",
324
+      "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz",
325
+      "integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E="
326
+    },
327
+    "sparse-bitfield": {
328
+      "version": "3.0.3",
329
+      "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz",
330
+      "integrity": "sha1-/0rm5oZWBWuks+eSqzM004JzyhE=",
331
+      "optional": true,
332
+      "requires": {
333
+        "memory-pager": "^1.0.2"
334
+      }
335
+    },
336
+    "supports-color": {
337
+      "version": "5.5.0",
338
+      "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
339
+      "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
340
+      "requires": {
341
+        "has-flag": "^3.0.0"
342
+      }
343
+    },
344
+    "tweetnacl": {
345
+      "version": "1.0.0",
346
+      "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.0.tgz",
347
+      "integrity": "sha1-cT2LgY2kIGh0C/aDhtBHnmb8ins="
348
+    },
349
+    "ws": {
350
+      "version": "6.1.0",
351
+      "resolved": "https://registry.npmjs.org/ws/-/ws-6.1.0.tgz",
352
+      "integrity": "sha512-H3dGVdGvW2H8bnYpIDc3u3LH8Wue3Qh+Zto6aXXFzvESkTVT6rAfKR6tR/+coaUvxs8yHtmNV0uioBF62ZGSTg==",
353
+      "requires": {
354
+        "async-limiter": "~1.0.0"
355
+      }
356
+    }
357
+  }
358
+}

+ 22
- 0
package.json View File

@@ -0,0 +1,22 @@
1
+{
2
+  "name": "bbot2018",
3
+  "version": "1.0.0",
4
+  "description": "",
5
+  "main": "index.js",
6
+  "scripts": {
7
+    "test": "echo \"Error: no test specified\" && exit 1"
8
+  },
9
+  "author": "",
10
+  "license": "MIT",
11
+  "dependencies": {
12
+    "@discordjs/uws": "^10.149.0",
13
+    "chalk": "^2.4.1",
14
+    "debug": "^4.0.1",
15
+    "discord.js": "git+https://github.com/discordjs/discord.js.git",
16
+    "dotenv": "^6.0.0",
17
+    "moment": "^2.22.2",
18
+    "mongodb": "^3.1.6",
19
+    "mongoose": "^5.3.0",
20
+    "pidusage": "^2.0.17"
21
+  }
22
+}

Loading…
Cancel
Save