catto.js 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/Bot.js +10 -6
  2. package/package.json +1 -1
package/Bot.js CHANGED
@@ -5,15 +5,19 @@ if (typeof EventEmitter !== "undefined") {} else {
5
5
  var { EventEmitter } = events;
6
6
  }
7
7
  module.exports = class extends EventEmitter {
8
- constructor(options) {
8
+ constructor(options, client) {
9
9
  super();
10
10
  this.options = Object.assign({
11
11
  "token": "",
12
12
  "intents": 98045
13
13
  }, options || {});
14
- this.client = new Discord.Client({
15
- "intents": new Discord.IntentsBitField(this.options.intents)
16
- });
14
+ if (client) {
15
+ this.client = client;
16
+ } else {
17
+ this.client = new Discord.Client({
18
+ "intents": new Discord.IntentsBitField(this.options.intents)
19
+ });
20
+ }
17
21
  this.commands = new Map();
18
22
  this.client.on("ready", () => {
19
23
  var cmds = [];
@@ -137,8 +141,8 @@ module.exports = class extends EventEmitter {
137
141
  this.client.on("guildCreate", guild => {
138
142
  this.emit("botAdd", guild);
139
143
  });
140
- this.client.on("guildRemove", guild => {
141
- this.emit("botRemove", guild);
144
+ this.client.on("guildDelete", guild => {
145
+ this.emit("botDelete", guild);
142
146
  });
143
147
  }
144
148
  slashCommand(basic, options, executor) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "catto.js",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "Universal module for everything.",
5
5
  "main": "index.js",
6
6
  "scripts": {