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.
- package/lib/client/base.js +1 -1
- package/lib/client/client.d.ts +3 -3
- package/lib/client/client.js +1 -1
- package/lib/client/workerclient.d.ts +1 -1
- package/lib/client/workerclient.js +1 -1
- package/lib/common/shorters/members.d.ts +3 -1
- package/lib/common/shorters/members.js +1 -0
- package/package.json +1 -1
package/lib/client/base.js
CHANGED
|
@@ -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;
|
package/lib/client/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CommandContext, Message } from '..';
|
|
2
|
-
import { type Awaitable, type DeepPartial, type
|
|
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:
|
|
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;
|
package/lib/client/client.js
CHANGED
|
@@ -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
|
|
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);
|