revbot.js 0.1.0 → 0.1.1
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.
- package/dist/index.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -265,6 +265,10 @@ interface ClientEvents {
|
|
|
265
265
|
interface clientOptions {
|
|
266
266
|
/** Whether to fetch all members of a server. */
|
|
267
267
|
fetchMembers?: boolean;
|
|
268
|
+
/** events for the client to ignore.*/
|
|
269
|
+
ignoreEvents?: string[];
|
|
270
|
+
/** Whether to ignore bot messages. */
|
|
271
|
+
ignoreBots?: boolean;
|
|
268
272
|
/** wether to use X-Session-Token or X-Bot-Token*/
|
|
269
273
|
isBot?: boolean;
|
|
270
274
|
/** Configuration for REST API requests. */
|
package/dist/index.d.ts
CHANGED
|
@@ -265,6 +265,10 @@ interface ClientEvents {
|
|
|
265
265
|
interface clientOptions {
|
|
266
266
|
/** Whether to fetch all members of a server. */
|
|
267
267
|
fetchMembers?: boolean;
|
|
268
|
+
/** events for the client to ignore.*/
|
|
269
|
+
ignoreEvents?: string[];
|
|
270
|
+
/** Whether to ignore bot messages. */
|
|
271
|
+
ignoreBots?: boolean;
|
|
268
272
|
/** wether to use X-Session-Token or X-Bot-Token*/
|
|
269
273
|
isBot?: boolean;
|
|
270
274
|
/** Configuration for REST API requests. */
|
package/dist/index.js
CHANGED
|
@@ -3235,7 +3235,7 @@ var import_node_events = require("events");
|
|
|
3235
3235
|
var import_axios4 = require("axios");
|
|
3236
3236
|
|
|
3237
3237
|
// package.json
|
|
3238
|
-
var version = "0.1.
|
|
3238
|
+
var version = "0.1.1";
|
|
3239
3239
|
|
|
3240
3240
|
// src/rest/restUtils/rateLimitQueue.ts
|
|
3241
3241
|
var import_axios3 = __toESM(require("axios"));
|
|
@@ -3765,8 +3765,12 @@ var Message = class extends Event {
|
|
|
3765
3765
|
*/
|
|
3766
3766
|
handle(data) {
|
|
3767
3767
|
return __async(this, null, function* () {
|
|
3768
|
+
var _a;
|
|
3768
3769
|
const channel = this.client.channels.cache.get(data.channel);
|
|
3769
3770
|
if (channel == null ? void 0 : channel.isText()) {
|
|
3771
|
+
if (((_a = data.user) == null ? void 0 : _a.bot) && this.client.options.ignoreBots) {
|
|
3772
|
+
return {};
|
|
3773
|
+
}
|
|
3770
3774
|
const message = channel.messages._add(data);
|
|
3771
3775
|
if (data.author !== SYSTEM_USER_ID && !data.webhook) {
|
|
3772
3776
|
yield this.client.users.fetch(data.author, { force: false });
|
|
@@ -4099,7 +4103,9 @@ var EventManager = class {
|
|
|
4099
4103
|
this.client = client3;
|
|
4100
4104
|
/** A map of registered events, keyed by their names. */
|
|
4101
4105
|
__privateAdd(this, _events, /* @__PURE__ */ new Map());
|
|
4102
|
-
|
|
4106
|
+
var _a;
|
|
4107
|
+
for (const [key, Event2] of Object.entries(EventMap)) {
|
|
4108
|
+
if ((_a = this.client.options.ignoreEvents) == null ? void 0 : _a.includes(key)) return;
|
|
4103
4109
|
this.register(Event2);
|
|
4104
4110
|
}
|
|
4105
4111
|
}
|