Skip to content

Commit 0a4a9d1

Browse files
authored
fix: types CacheType should not be undefined (#459)
fix: types CacheType should not be undefined
2 parents 9f5e01a + 4c6e0d1 commit 0a4a9d1

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/lib/structures/contexts/AutocompleteContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class AutocompleteContext<
2424
public readonly argumentName: string;
2525
public readonly value: string | number;
2626
public respond: (choices: Array<ArgumentChoice>) => Promise<void>;
27-
public inGuild: () => this is AutocompleteContext<undefined>;
27+
public inGuild: () => this is AutocompleteContext<'raw' | 'cached'>;
2828
public inCachedGuild: () => this is AutocompleteContext<'cached'>;
2929
public inRawGuild: () => this is AutocompleteContext<'raw'>;
3030

src/lib/structures/contexts/CommandContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export class CommandContext<
6969
| MessagePayload
7070
| InteractionReplyOptions,
7171
) => Promise<Fetch extends true ? GuildCacheMessage<Cached> : void>;
72-
public inGuild: () => this is CommandContext<undefined>;
72+
public inGuild: () => this is CommandContext<'raw' | 'cached'>;
7373
public inCachedGuild: () => this is CommandContext<'cached'>;
7474
public inRawGuild: () => this is CommandContext<'raw'>;
7575

src/lib/structures/contexts/ComponentContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export class ComponentContext<
7979
| MessagePayload
8080
| InteractionReplyOptions,
8181
) => Promise<Fetch extends true ? GuildCacheMessage<Cached> : void>;
82-
public inGuild: () => this is ComponentContext<undefined>;
82+
public inGuild: () => this is ComponentContext<'raw' | 'cached'>;
8383
public inCachedGuild: () => this is ComponentContext<'cached'>;
8484
public inRawGuild: () => this is ComponentContext<'raw'>;
8585

src/lib/structures/contexts/Context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export class Context<Cached extends CacheType = CacheType> {
7171
this.memberPermissions = options.memberPermissions;
7272
}
7373

74-
public inGuild(): this is Context<undefined> {
74+
public inGuild(): this is Context<'raw' | 'cached'> {
7575
return Boolean(this.guildId && this.member);
7676
}
7777

0 commit comments

Comments
 (0)