revbot.js 0.1.0 → 0.1.2

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.mjs CHANGED
@@ -637,6 +637,10 @@ var User = class extends Base {
637
637
  get createdAt() {
638
638
  return UUID.timestampOf(this.id);
639
639
  }
640
+ get isOwner() {
641
+ var _a;
642
+ return this.id === ((_a = this.client.user) == null ? void 0 : _a.owner);
643
+ }
640
644
  /**
641
645
  * Gets the creation timestamp of the user in milliseconds.
642
646
  *
@@ -3157,7 +3161,7 @@ import { EventEmitter } from "node:events";
3157
3161
  import { AxiosError } from "axios";
3158
3162
 
3159
3163
  // package.json
3160
- var version = "0.1.0";
3164
+ var version = "0.1.2";
3161
3165
 
3162
3166
  // src/rest/restUtils/rateLimitQueue.ts
3163
3167
  import axios3 from "axios";
@@ -3687,8 +3691,12 @@ var Message = class extends Event {
3687
3691
  */
3688
3692
  handle(data) {
3689
3693
  return __async(this, null, function* () {
3694
+ var _a;
3690
3695
  const channel = this.client.channels.cache.get(data.channel);
3691
3696
  if (channel == null ? void 0 : channel.isText()) {
3697
+ if (((_a = data.user) == null ? void 0 : _a.bot) && this.client.options.ignoreBots) {
3698
+ return {};
3699
+ }
3692
3700
  const message = channel.messages._add(data);
3693
3701
  if (data.author !== SYSTEM_USER_ID && !data.webhook) {
3694
3702
  yield this.client.users.fetch(data.author, { force: false });
@@ -4021,7 +4029,9 @@ var EventManager = class {
4021
4029
  this.client = client3;
4022
4030
  /** A map of registered events, keyed by their names. */
4023
4031
  __privateAdd(this, _events, /* @__PURE__ */ new Map());
4024
- for (const Event2 of Object.values(EventMap)) {
4032
+ var _a;
4033
+ for (const [key, Event2] of Object.entries(EventMap)) {
4034
+ if ((_a = this.client.options.ignoreEvents) == null ? void 0 : _a.includes(key)) return;
4025
4035
  this.register(Event2);
4026
4036
  }
4027
4037
  }
@@ -4048,10 +4058,14 @@ _events = new WeakMap();
4048
4058
 
4049
4059
  // src/struct/clientUser.ts
4050
4060
  var ClientUser = class extends User {
4051
- constructor() {
4052
- super(...arguments);
4061
+ constructor(client3, data) {
4062
+ var _a;
4063
+ super(client3, data);
4053
4064
  /** The notes channel associated with the client user, if any. */
4054
4065
  this.notes = null;
4066
+ this.owner = null;
4067
+ this._patch(data);
4068
+ this.owner = ((_a = data.bot) == null ? void 0 : _a.owner) || null;
4055
4069
  }
4056
4070
  /**
4057
4071
  * Updates the username of the client user.