seyfert 2.1.1-dev-11697693162.0 → 2.1.1-dev-11727465603.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.
@@ -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'>>;
@@ -132,5 +132,8 @@ class CommandContext extends basecontext_1.BaseContext {
132
132
  isChat() {
133
133
  return true;
134
134
  }
135
+ inGuild() {
136
+ return !!this.guildId;
137
+ }
135
138
  }
136
139
  exports.CommandContext = CommandContext;
@@ -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
  }
@@ -48,5 +48,8 @@ class BaseContext {
48
48
  isStringSelectMenu() {
49
49
  return false;
50
50
  }
51
+ isEntryPoint() {
52
+ return false;
53
+ }
51
54
  }
52
55
  exports.BaseContext = BaseContext;
@@ -4,7 +4,7 @@ import { BaseHandler } from '../common';
4
4
  import { type APIApplicationCommandOption, type LocalizationMap } from '../types';
5
5
  import { Command, type CommandOption, SubCommand } from './applications/chat';
6
6
  import { ContextMenuCommand } from './applications/menu';
7
- import type { UsingClient } from './applications/shared';
7
+ import { type UsingClient } from './applications/shared';
8
8
  export declare class CommandHandler extends BaseHandler {
9
9
  protected logger: Logger;
10
10
  protected client: UsingClient;
@@ -8,6 +8,7 @@ const Permissions_1 = require("../structures/extra/Permissions");
8
8
  const types_1 = require("../types");
9
9
  const chat_1 = require("./applications/chat");
10
10
  const menu_1 = require("./applications/menu");
11
+ const shared_1 = require("./applications/shared");
11
12
  class CommandHandler extends common_1.BaseHandler {
12
13
  logger;
13
14
  client;
@@ -143,6 +144,8 @@ class CommandHandler extends common_1.BaseHandler {
143
144
  }
144
145
  async shouldUpload(file, guildId) {
145
146
  const values = this.values.filter(x => {
147
+ if ('ignore' in x && x.ignore === shared_1.IgnoreCommand.Slash)
148
+ return false;
146
149
  if (!guildId)
147
150
  return !x.guildId;
148
151
  return x.guildId?.includes(guildId);
@@ -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'>>;
@@ -134,5 +134,8 @@ class ModalContext extends basecontext_1.BaseContext {
134
134
  isModal() {
135
135
  return true;
136
136
  }
137
+ inGuild() {
138
+ return !!this.guildId;
139
+ }
137
140
  }
138
141
  exports.ModalContext = ModalContext;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seyfert",
3
- "version": "2.1.1-dev-11697693162.0",
3
+ "version": "2.1.1-dev-11727465603.0",
4
4
  "description": "The most advanced framework for discord bots",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",