seyfert 2.2.1-dev-12626895432.0 → 2.2.1-dev-12681581510.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/events/event.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export interface ClientDataEvent {
|
|
|
11
11
|
export type CallbackEventHandler = {
|
|
12
12
|
[K in keyof ClientEvents]: (...data: [Awaited<ClientEvents[K]>, UsingClient, number]) => unknown;
|
|
13
13
|
} & {
|
|
14
|
-
[K in keyof CustomEvents]: (...data: [Parameters<CustomEvents[K]>, UsingClient, number]) => unknown;
|
|
14
|
+
[K in keyof CustomEvents]: (...data: [...Parameters<CustomEvents[K]>, UsingClient, number]) => unknown;
|
|
15
15
|
};
|
|
16
16
|
export type EventContext<T extends {
|
|
17
17
|
data: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AllChannels, Embed } from '..';
|
|
1
|
+
import { type AllChannels, Embed, ReturnCache } from '..';
|
|
2
2
|
import type { ListenerOptions } from '../builders';
|
|
3
3
|
import { type GuildMemberStructure, type GuildStructure, type MessageStructure, type PollStructure, type UserStructure, type WebhookMessageStructure, type WebhookStructure } from '../client/transformers';
|
|
4
4
|
import type { UsingClient } from '../commands';
|
|
@@ -30,7 +30,8 @@ export declare class BaseMessage extends DiscordBase {
|
|
|
30
30
|
get user(): UserStructure;
|
|
31
31
|
createComponentCollector(options?: ListenerOptions): import("../components/handler").CreateComponentCollectorResult;
|
|
32
32
|
get url(): `https://discord.com/channels/${string}/${string}/${string}`;
|
|
33
|
-
guild(
|
|
33
|
+
guild(mode?: 'rest' | 'flow'): Promise<GuildStructure<'cached' | 'api'> | undefined>;
|
|
34
|
+
guild(mode: 'cache'): ReturnCache<GuildStructure<'cached'> | undefined>;
|
|
34
35
|
channel(force?: boolean): Promise<AllChannels>;
|
|
35
36
|
react(emoji: EmojiResolvable): Promise<void>;
|
|
36
37
|
private patch;
|
|
@@ -29,10 +29,15 @@ class BaseMessage extends DiscordBase_1.DiscordBase {
|
|
|
29
29
|
get url() {
|
|
30
30
|
return common_2.Formatter.messageLink(this.guildId ?? '@me', this.channelId, this.id);
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
guild(mode = 'flow') {
|
|
33
33
|
if (!this.guildId)
|
|
34
|
-
return;
|
|
35
|
-
|
|
34
|
+
return (mode === 'cache' ? (this.client.cache.adapter.isAsync ? Promise.resolve() : undefined) : Promise.resolve());
|
|
35
|
+
switch (mode) {
|
|
36
|
+
case 'cache':
|
|
37
|
+
return this.client.cache.guilds?.get(this.guildId);
|
|
38
|
+
default:
|
|
39
|
+
return this.client.guilds.fetch(this.guildId, mode === 'rest');
|
|
40
|
+
}
|
|
36
41
|
}
|
|
37
42
|
channel(force = false) {
|
|
38
43
|
return this.client.channels.fetch(this.channelId, force);
|