seyfert 2.1.1-dev-11697693162.0 → 2.1.1-dev-11711415950.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/commands/applications/chatcontext.d.ts +2 -1
- package/lib/commands/applications/chatcontext.js +3 -0
- package/lib/commands/applications/entrycontext.d.ts +2 -0
- package/lib/commands/applications/entrycontext.js +6 -0
- package/lib/commands/applications/menucontext.d.ts +1 -0
- package/lib/commands/applications/menucontext.js +3 -0
- package/lib/commands/basecontext.d.ts +2 -0
- package/lib/commands/basecontext.js +3 -0
- package/lib/components/componentcontext.d.ts +8 -7
- package/lib/components/componentcontext.js +3 -0
- package/lib/components/modalcontext.d.ts +2 -1
- package/lib/components/modalcontext.js +3 -0
- package/package.json +1 -1
|
@@ -42,7 +42,8 @@ export declare class CommandContext<T extends OptionsRecord = {}, M extends keyo
|
|
|
42
42
|
get channelId(): string;
|
|
43
43
|
get author(): import("../..").User;
|
|
44
44
|
get member(): If<InferWithPrefix, GuildMemberStructure | InteractionGuildMemberStructure | undefined, InteractionGuildMemberStructure | undefined>;
|
|
45
|
-
isChat(): this is CommandContext
|
|
45
|
+
isChat(): this is CommandContext<T, M>;
|
|
46
|
+
inGuild(): this is GuildCommandContext<T, M>;
|
|
46
47
|
}
|
|
47
48
|
export interface GuildCommandContext<T extends OptionsRecord = {}, M extends keyof RegisteredMiddlewares = never> extends Omit<MakeRequired<CommandContext<T, M>, 'guildId'>, 'guild'> {
|
|
48
49
|
guild(mode?: 'rest' | 'flow'): Promise<GuildStructure<'cached' | 'api'>>;
|
|
@@ -37,6 +37,8 @@ export declare class EntryPointContext<M extends keyof RegisteredMiddlewares = n
|
|
|
37
37
|
get channelId(): string;
|
|
38
38
|
get author(): import("../..").User;
|
|
39
39
|
get member(): import("../..").InteractionGuildMember | undefined;
|
|
40
|
+
isEntryPoint(): this is EntryPointContext<M>;
|
|
41
|
+
inGuild(): this is GuildEntryPointContext<M>;
|
|
40
42
|
}
|
|
41
43
|
export interface GuildEntryPointContext<M extends keyof RegisteredMiddlewares = never> extends Omit<MakeRequired<EntryPointContext<M>, 'guildId'>, 'guild'> {
|
|
42
44
|
guild(mode?: 'rest' | 'flow'): Promise<GuildStructure<'cached' | 'api'>>;
|
|
@@ -81,5 +81,11 @@ class EntryPointContext extends basecontext_1.BaseContext {
|
|
|
81
81
|
get member() {
|
|
82
82
|
return this.interaction.member;
|
|
83
83
|
}
|
|
84
|
+
isEntryPoint() {
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
inGuild() {
|
|
88
|
+
return !!this.guildId;
|
|
89
|
+
}
|
|
84
90
|
}
|
|
85
91
|
exports.EntryPointContext = EntryPointContext;
|
|
@@ -41,6 +41,7 @@ export declare class MenuCommandContext<T extends MessageCommandInteraction | Us
|
|
|
41
41
|
isMenu(): this is MenuCommandContext<UserCommandInteraction | MessageCommandInteraction>;
|
|
42
42
|
isMenuUser(): this is MenuCommandContext<UserCommandInteraction>;
|
|
43
43
|
isMenuMessage(): this is MenuCommandContext<MessageCommandInteraction>;
|
|
44
|
+
inGuild(): this is GuildMenuCommandContext<T, M>;
|
|
44
45
|
}
|
|
45
46
|
export interface GuildMenuCommandContext<T extends MessageCommandInteraction | UserCommandInteraction, M extends keyof RegisteredMiddlewares = never> extends Omit<MakeRequired<MenuCommandContext<T, M>, 'guildId'>, 'guild'> {
|
|
46
47
|
guild(mode?: 'rest' | 'flow'): Promise<GuildStructure<'cached' | 'api'>>;
|
|
@@ -105,5 +105,8 @@ class MenuCommandContext extends basecontext_1.BaseContext {
|
|
|
105
105
|
isMenuMessage() {
|
|
106
106
|
return this.interaction.data.type === types_1.ApplicationCommandType.Message;
|
|
107
107
|
}
|
|
108
|
+
inGuild() {
|
|
109
|
+
return !!this.guildId;
|
|
110
|
+
}
|
|
108
111
|
}
|
|
109
112
|
exports.MenuCommandContext = MenuCommandContext;
|
|
@@ -2,6 +2,7 @@ import type { ModalContext } from '../components';
|
|
|
2
2
|
import type { ComponentContext, ContextComponentCommandInteractionMap } from '../components/componentcontext';
|
|
3
3
|
import type { MessageCommandInteraction, UserCommandInteraction } from '../structures';
|
|
4
4
|
import type { CommandContext } from './applications/chatcontext';
|
|
5
|
+
import type { EntryPointContext } from './applications/entrycontext';
|
|
5
6
|
import type { MenuCommandContext } from './applications/menucontext';
|
|
6
7
|
import type { UsingClient } from './applications/shared';
|
|
7
8
|
export declare class BaseContext {
|
|
@@ -23,4 +24,5 @@ export declare class BaseContext {
|
|
|
23
24
|
isMentionableSelectMenu(): this is ComponentContext<'MentionableSelect'>;
|
|
24
25
|
isUserSelectMenu(): this is ComponentContext<'UserSelect'>;
|
|
25
26
|
isStringSelectMenu(): this is ComponentContext<'StringSelect'>;
|
|
27
|
+
isEntryPoint(): this is EntryPointContext;
|
|
26
28
|
}
|
|
@@ -110,12 +110,13 @@ export declare class ComponentContext<Type extends keyof ContextComponentCommand
|
|
|
110
110
|
*/
|
|
111
111
|
get member(): import("..").InteractionGuildMember | undefined;
|
|
112
112
|
isComponent(): this is ComponentContext<keyof ContextComponentCommandInteractionMap>;
|
|
113
|
-
isButton(): this is ComponentContext<'Button'>;
|
|
114
|
-
isChannelSelectMenu(): this is ComponentContext<'ChannelSelect'>;
|
|
115
|
-
isRoleSelectMenu(): this is ComponentContext<'RoleSelect'>;
|
|
116
|
-
isMentionableSelectMenu(): this is ComponentContext<'MentionableSelect'>;
|
|
117
|
-
isUserSelectMenu(): this is ComponentContext<'UserSelect'>;
|
|
118
|
-
isStringSelectMenu(): this is ComponentContext<'StringSelect'>;
|
|
113
|
+
isButton(): this is ComponentContext<'Button', M>;
|
|
114
|
+
isChannelSelectMenu(): this is ComponentContext<'ChannelSelect', M>;
|
|
115
|
+
isRoleSelectMenu(): this is ComponentContext<'RoleSelect', M>;
|
|
116
|
+
isMentionableSelectMenu(): this is ComponentContext<'MentionableSelect', M>;
|
|
117
|
+
isUserSelectMenu(): this is ComponentContext<'UserSelect', M>;
|
|
118
|
+
isStringSelectMenu(): this is ComponentContext<'StringSelect', M>;
|
|
119
|
+
inGuild(): this is GuildComponentContext<Type, M>;
|
|
119
120
|
}
|
|
120
121
|
export interface ContextComponentCommandInteractionMap {
|
|
121
122
|
Button: ButtonInteraction;
|
|
@@ -125,7 +126,7 @@ export interface ContextComponentCommandInteractionMap {
|
|
|
125
126
|
MentionableSelect: MentionableSelectMenuInteraction;
|
|
126
127
|
ChannelSelect: ChannelSelectMenuInteraction;
|
|
127
128
|
}
|
|
128
|
-
export interface GuildComponentContext<M extends keyof RegisteredMiddlewares = never> extends Omit<MakeRequired<ComponentContext<M>, 'guildId'>, 'guild'> {
|
|
129
|
+
export interface GuildComponentContext<Type extends keyof ContextComponentCommandInteractionMap, M extends keyof RegisteredMiddlewares = never> extends Omit<MakeRequired<ComponentContext<Type, M>, 'guildId'>, 'guild'> {
|
|
129
130
|
guild(mode?: 'rest' | 'flow'): Promise<GuildStructure<'cached' | 'api'>>;
|
|
130
131
|
guild(mode?: 'cache'): ReturnCache<GuildStructure<'cached'> | undefined>;
|
|
131
132
|
}
|
|
@@ -164,5 +164,8 @@ class ComponentContext extends basecontext_1.BaseContext {
|
|
|
164
164
|
isStringSelectMenu() {
|
|
165
165
|
return this.interaction.componentType === types_1.ComponentType.StringSelect;
|
|
166
166
|
}
|
|
167
|
+
inGuild() {
|
|
168
|
+
return !!this.guildId;
|
|
169
|
+
}
|
|
167
170
|
}
|
|
168
171
|
exports.ComponentContext = ComponentContext;
|
|
@@ -105,7 +105,8 @@ export declare class ModalContext<M extends keyof RegisteredMiddlewares = never>
|
|
|
105
105
|
* Gets the member of the interaction.
|
|
106
106
|
*/
|
|
107
107
|
get member(): import("..").InteractionGuildMember | undefined;
|
|
108
|
-
isModal(): this is ModalContext
|
|
108
|
+
isModal(): this is ModalContext<M>;
|
|
109
|
+
inGuild(): this is GuildModalContext<M>;
|
|
109
110
|
}
|
|
110
111
|
export interface GuildModalContext<M extends keyof RegisteredMiddlewares = never> extends Omit<MakeRequired<ModalContext<M>, 'guildId'>, 'guild'> {
|
|
111
112
|
guild(mode?: 'rest' | 'flow'): Promise<GuildStructure<'cached' | 'api'>>;
|