revbot.js 0.1.2 → 0.1.3

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 CHANGED
@@ -601,6 +601,9 @@ declare class User extends Base {
601
601
  * @returns {Date} The date when the user was created.
602
602
  */
603
603
  get createdAt(): Date;
604
+ /**
605
+ * checks if the user is the owner of the bot.
606
+ */
604
607
  get isOwner(): boolean;
605
608
  /**
606
609
  * Gets the creation timestamp of the user in milliseconds.
@@ -869,10 +872,11 @@ declare class Attachment extends Base {
869
872
  * Enum representing the possible presence statuses of a user.
870
873
  */
871
874
  declare enum Status {
872
- Online = "ONLINE",
873
- Idle = "IDLE",
874
- Busy = "DND",
875
- Invisible = "OFFLINE"
875
+ Online = "Online",
876
+ Idle = "Idle",
877
+ Focus = "Focus",
878
+ Busy = "Busy",
879
+ Invisible = "Invisible"
876
880
  }
877
881
  /**
878
882
  * Represents the presence of a user, including their status and custom text.
@@ -2074,10 +2078,12 @@ declare class ClientUser extends User {
2074
2078
  *
2075
2079
  * @example
2076
2080
  * ```typescript
2077
- * await clientUser.setStatus("Available", "online");
2081
+ * await clientUser.setStatus("Available", "Online");
2078
2082
  * ```
2079
2083
  */
2080
- setStatus(text: string | null, presence?: Status): Promise<void>;
2084
+ setStatus(text?: string | null): Promise<void>;
2085
+ setStatus(presence?: Status): Promise<void>;
2086
+ setStatus(text?: string | null, presence?: keyof typeof Status): Promise<void>;
2081
2087
  }
2082
2088
 
2083
2089
  /**
package/dist/index.d.ts CHANGED
@@ -601,6 +601,9 @@ declare class User extends Base {
601
601
  * @returns {Date} The date when the user was created.
602
602
  */
603
603
  get createdAt(): Date;
604
+ /**
605
+ * checks if the user is the owner of the bot.
606
+ */
604
607
  get isOwner(): boolean;
605
608
  /**
606
609
  * Gets the creation timestamp of the user in milliseconds.
@@ -869,10 +872,11 @@ declare class Attachment extends Base {
869
872
  * Enum representing the possible presence statuses of a user.
870
873
  */
871
874
  declare enum Status {
872
- Online = "ONLINE",
873
- Idle = "IDLE",
874
- Busy = "DND",
875
- Invisible = "OFFLINE"
875
+ Online = "Online",
876
+ Idle = "Idle",
877
+ Focus = "Focus",
878
+ Busy = "Busy",
879
+ Invisible = "Invisible"
876
880
  }
877
881
  /**
878
882
  * Represents the presence of a user, including their status and custom text.
@@ -2074,10 +2078,12 @@ declare class ClientUser extends User {
2074
2078
  *
2075
2079
  * @example
2076
2080
  * ```typescript
2077
- * await clientUser.setStatus("Available", "online");
2081
+ * await clientUser.setStatus("Available", "Online");
2078
2082
  * ```
2079
2083
  */
2080
- setStatus(text: string | null, presence?: Status): Promise<void>;
2084
+ setStatus(text?: string | null): Promise<void>;
2085
+ setStatus(presence?: Status): Promise<void>;
2086
+ setStatus(text?: string | null, presence?: keyof typeof Status): Promise<void>;
2081
2087
  }
2082
2088
 
2083
2089
  /**
package/dist/index.js CHANGED
@@ -697,13 +697,13 @@ var User = class extends Base {
697
697
  this.avatar = new Attachment(this.client, data.avatar);
698
698
  }
699
699
  if (data.status) {
700
- this.presence.status = data.status.presence ? (_a = Status[data.status.presence]) != null ? _a : "OFFLINE" /* Invisible */ : "OFFLINE" /* Invisible */;
700
+ this.presence.status = data.status.presence ? (_a = Status[data.status.presence]) != null ? _a : "Invisible" /* Invisible */ : "Invisible" /* Invisible */;
701
701
  this.presence.text = (_b = data.status.text) != null ? _b : null;
702
702
  }
703
703
  for (const field of clear) {
704
704
  if (field === "Avatar") this.avatar = null;
705
705
  if (field === "StatusText") this.presence.text = null;
706
- if (field === "StatusPresence") this.presence.status = "OFFLINE" /* Invisible */;
706
+ if (field === "StatusPresence") this.presence.status = "Invisible" /* Invisible */;
707
707
  }
708
708
  return this;
709
709
  }
@@ -715,6 +715,9 @@ var User = class extends Base {
715
715
  get createdAt() {
716
716
  return UUID.timestampOf(this.id);
717
717
  }
718
+ /**
719
+ * checks if the user is the owner of the bot.
720
+ */
718
721
  get isOwner() {
719
722
  var _a;
720
723
  return this.id === ((_a = this.client.user) == null ? void 0 : _a.owner);
@@ -1081,12 +1084,13 @@ var Attachment = class extends Base {
1081
1084
  };
1082
1085
 
1083
1086
  // src/struct/presence.ts
1084
- var Status = /* @__PURE__ */ ((Status3) => {
1085
- Status3["Online"] = "ONLINE";
1086
- Status3["Idle"] = "IDLE";
1087
- Status3["Busy"] = "DND";
1088
- Status3["Invisible"] = "OFFLINE";
1089
- return Status3;
1087
+ var Status = /* @__PURE__ */ ((Status2) => {
1088
+ Status2["Online"] = "Online";
1089
+ Status2["Idle"] = "Idle";
1090
+ Status2["Focus"] = "Focus";
1091
+ Status2["Busy"] = "Busy";
1092
+ Status2["Invisible"] = "Invisible";
1093
+ return Status2;
1090
1094
  })(Status || {});
1091
1095
  var Presence = class extends Base {
1092
1096
  constructor() {
@@ -1094,7 +1098,7 @@ var Presence = class extends Base {
1094
1098
  /** The custom status text of the user, or `null` if none is set. */
1095
1099
  this.text = null;
1096
1100
  /** The current status of the user (e.g., Online, Idle, Busy, Invisible). */
1097
- this.status = "OFFLINE" /* Invisible */;
1101
+ this.status = "Invisible" /* Invisible */;
1098
1102
  }
1099
1103
  };
1100
1104
 
@@ -3239,7 +3243,7 @@ var import_node_events = require("events");
3239
3243
  var import_axios4 = require("axios");
3240
3244
 
3241
3245
  // package.json
3242
- var version = "0.1.2";
3246
+ var version = "0.1.3";
3243
3247
 
3244
3248
  // src/rest/restUtils/rateLimitQueue.ts
3245
3249
  var import_axios3 = __toESM(require("axios"));
@@ -4168,22 +4172,19 @@ var ClientUser = class extends User {
4168
4172
  });
4169
4173
  });
4170
4174
  }
4171
- /**
4172
- * Updates the status of the client user.
4173
- *
4174
- * @param {string | null} text - The status text to set, or `null` to clear the status.
4175
- * @param {Status} [presence] - The presence status (e.g., online, idle, etc.).
4176
- * @returns {Promise<void>} A promise that resolves when the status has been successfully updated.
4177
- *
4178
- * @example
4179
- * ```typescript
4180
- * await clientUser.setStatus("Available", "online");
4181
- * ```
4182
- */
4183
4175
  setStatus(text, presence) {
4184
4176
  return __async(this, null, function* () {
4185
- yield this.client.api.patch("/users/@me", {
4186
- body: { status: { text, presence } }
4177
+ var _a, _b, _c;
4178
+ if (typeof text === "string" && text in Status) {
4179
+ presence = text;
4180
+ text = void 0;
4181
+ }
4182
+ const status = {
4183
+ text: text != null ? text : (_a = this.client.user) == null ? void 0 : _a.presence.text,
4184
+ presence: presence != null ? presence : (_b = this.client.user) == null ? void 0 : _b.presence.status
4185
+ };
4186
+ yield this.client.api.patch(`/users/${(_c = this.client.user) == null ? void 0 : _c.id}`, {
4187
+ body: { status }
4187
4188
  });
4188
4189
  });
4189
4190
  }