seyfert 3.2.5-dev-16124471814.0 → 3.2.5-dev-16254781135.0

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.
@@ -111,7 +111,7 @@ class BaseClient {
111
111
  this._botId = id;
112
112
  }
113
113
  get botId() {
114
- return this._botId ?? BaseClient.getBotIdFromToken(this.rest.options.token);
114
+ return this._botId ?? BaseClient.getBotIdFromToken(this.rest.options.token) ?? '';
115
115
  }
116
116
  set applicationId(id) {
117
117
  this._applicationId = id;
@@ -1,5 +1,5 @@
1
1
  import type { CommandContext, Message } from '..';
2
- import { type Awaitable, type DeepPartial, type If, type PickPartial } from '../common';
2
+ import { type Awaitable, type DeepPartial, type PickPartial, When } from '../common';
3
3
  import { EventHandler } from '../events';
4
4
  import type { GatewayDispatchPayload, GatewayPresenceUpdateData } from '../types';
5
5
  import { ShardManager, type ShardManagerOptions } from '../websocket';
@@ -11,7 +11,7 @@ import { Collectors } from './collectors';
11
11
  import { type ClientUserStructure, type MessageStructure } from './transformers';
12
12
  export declare class Client<Ready extends boolean = boolean> extends BaseClient {
13
13
  gateway: ShardManager;
14
- me: If<Ready, ClientUserStructure>;
14
+ me: When<Ready, ClientUserStructure>;
15
15
  options: Omit<ClientOptions, 'commands'> & {
16
16
  commands: NonNullable<ClientOptions['commands']>;
17
17
  };
@@ -20,7 +20,7 @@ export declare class Client<Ready extends boolean = boolean> extends BaseClient
20
20
  collectors: Collectors;
21
21
  events: EventHandler;
22
22
  constructor(options?: ClientOptions);
23
- get applicationId(): string;
23
+ get applicationId(): When<Ready, string, ''>;
24
24
  set applicationId(id: string);
25
25
  setServices({ gateway, ...rest }: ServicesOptions & {
26
26
  gateway?: ShardManager;
@@ -21,7 +21,7 @@ class Client extends base_1.BaseClient {
21
21
  super(options);
22
22
  }
23
23
  get applicationId() {
24
- return this.me?.application.id ?? super.applicationId;
24
+ return (this.me?.application.id ?? super.applicationId);
25
25
  }
26
26
  set applicationId(id) {
27
27
  super.applicationId = id;
@@ -29,7 +29,7 @@ export declare class WorkerClient<Ready extends boolean = boolean> extends BaseC
29
29
  constructor(options?: WorkerClientOptions);
30
30
  get workerId(): number;
31
31
  get latency(): number;
32
- get applicationId(): string;
32
+ get applicationId(): When<Ready, string, ''>;
33
33
  set applicationId(id: string);
34
34
  setServices(rest: ServicesOptions): void;
35
35
  setWorkerData(data: WorkerData): void;
@@ -66,7 +66,7 @@ class WorkerClient extends base_1.BaseClient {
66
66
  return acc / this.shards.size;
67
67
  }
68
68
  get applicationId() {
69
- return this.me?.application.id ?? super.applicationId;
69
+ return (this.me?.application.id ?? super.applicationId);
70
70
  }
71
71
  set applicationId(id) {
72
72
  super.applicationId = id;
@@ -48,7 +48,9 @@ export declare class MemberShorter extends BaseShorter {
48
48
  * @param reason The reason for editing the member.
49
49
  * @returns A Promise that resolves to the edited member.
50
50
  */
51
- edit(guildId: string, memberId: string, body: RESTPatchAPIGuildMemberJSONBody, reason?: string): Promise<GuildMemberStructure>;
51
+ edit(guildId: string, memberId: string, body: RESTPatchAPIGuildMemberJSONBody | {
52
+ nick?: string;
53
+ }, reason?: string): Promise<GuildMemberStructure>;
52
54
  /**
53
55
  * Adds a member to the guild.
54
56
  * @param guildId The ID of the guild.
@@ -83,6 +83,7 @@ class MemberShorter extends base_1.BaseShorter {
83
83
  * @returns A Promise that resolves to the edited member.
84
84
  */
85
85
  async edit(guildId, memberId, body, reason) {
86
+ memberId = memberId === this.client.botId && body.nick ? '@me' : memberId;
86
87
  const member = await this.client.proxy.guilds(guildId).members(memberId).patch({ body, reason });
87
88
  await this.client.cache.members?.setIfNI(cache_1.CacheFrom.Rest, 'GuildMembers', memberId, guildId, member);
88
89
  return transformers_1.Transformers.GuildMember(this.client, member, member.user, guildId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seyfert",
3
- "version": "3.2.5-dev-16124471814.0",
3
+ "version": "3.2.5-dev-16254781135.0",
4
4
  "description": "The most advanced framework for discord bots",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",