seyfert 2.1.1-dev-12511254197.0 → 2.1.1-dev-12522165110.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.
@@ -2,19 +2,19 @@ import { type If, Logger } from '../common';
2
2
  import type { Adapter } from './adapters';
3
3
  import { Guilds } from './resources/guilds';
4
4
  import { Users } from './resources/users';
5
+ import type { InternalOptions, UsingClient } from '../commands';
6
+ import { type GatewayDispatchPayload, GatewayIntentBits } from '../types';
5
7
  import { Bans } from './resources/bans';
6
8
  import { Channels } from './resources/channels';
7
9
  import { Emojis } from './resources/emojis';
8
10
  import { Members } from './resources/members';
11
+ import { Messages } from './resources/messages';
12
+ import { Overwrites } from './resources/overwrites';
9
13
  import { Presences } from './resources/presence';
10
14
  import { Roles } from './resources/roles';
11
15
  import { StageInstances } from './resources/stage-instances';
12
16
  import { Stickers } from './resources/stickers';
13
17
  import { VoiceStates } from './resources/voice-states';
14
- import type { InternalOptions, UsingClient } from '../commands';
15
- import { type GatewayDispatchPayload, GatewayIntentBits } from '../types';
16
- import { Messages } from './resources/messages';
17
- import { Overwrites } from './resources/overwrites';
18
18
  export { BaseResource } from './resources/default/base';
19
19
  export { GuildBasedResource } from './resources/default/guild-based';
20
20
  export { GuildRelatedResource } from './resources/default/guild-related';
@@ -26,6 +26,9 @@ export type GuildBased = 'members' | 'voiceStates';
26
26
  export type GuildRelated = 'emojis' | 'roles' | 'channels' | 'stickers' | 'presences' | 'stageInstances' | 'overwrites' | 'messages' | 'bans';
27
27
  export type NonGuildBased = 'users' | 'guilds';
28
28
  export type SeyfertBased = 'onPacket';
29
+ type ReturnManagers = {
30
+ [K in NonGuildBased | GuildBased | GuildRelated]: NonNullable<Awaited<ReturnType<NonNullable<Cache[K]>['get']>>>;
31
+ };
29
32
  export * from './adapters/index';
30
33
  export type CachedEvents = 'READY' | 'GUILD_CREATE' | 'GUILD_UPDATE' | 'GUILD_DELETE' | 'CHANNEL_CREATE' | 'CHANNEL_UPDATE' | 'CHANNEL_DELETE' | 'GUILD_ROLE_CREATE' | 'GUILD_ROLE_UPDATE' | 'GUILD_ROLE_DELETE' | 'GUILD_BAN_ADD' | 'GUILD_BAN_REMOVE' | 'GUILD_EMOJIS_UPDATE' | 'GUILD_STICKERS_UPDATE' | 'GUILD_MEMBER_ADD' | 'GUILD_MEMBER_UPDATE' | 'GUILD_MEMBER_REMOVE' | 'MESSAGE_CREATE' | 'PRESENCE_UPDATE' | 'THREAD_DELETE' | 'THREAD_CREATE' | 'THREAD_UPDATE' | 'USER_UPDATE' | 'VOICE_STATE_UPDATE' | 'STAGE_INSTANCE_CREATE' | 'STAGE_INSTANCE_UPDATE' | 'STAGE_INSTANCE_DELETE';
31
34
  export type DisabledCache = {
@@ -69,32 +72,19 @@ export declare class Cache {
69
72
  string,
70
73
  string
71
74
  ])[]): Promise<Partial<{
72
- guilds: import("..").Guild<"cached">[];
73
- roles: import("..").GuildRole[];
74
- emojis: import("..").GuildEmoji[];
75
- stickers: import("..").Sticker[];
76
- members: import("..").GuildMember[];
77
- users: import("..").User[];
78
- channels: NonNullable<ReturnCache<import("..").AllChannels | undefined>>[];
79
- voiceStates: import("..").VoiceState[];
80
- presences: (Omit<import("../types").GatewayPresenceUpdate, "user"> & {
81
- id: string;
82
- user_id: string;
83
- } & {
84
- guild_id: string;
85
- })[];
86
- stageInstances: (import("../types").APIStageInstance & {
87
- guild_id: string;
88
- })[];
89
- overwrites: {
90
- type: number;
91
- id: string;
92
- deny: import("../structures/extra/Permissions").PermissionsBitField;
93
- allow: import("../structures/extra/Permissions").PermissionsBitField;
94
- guildId: string;
95
- }[][];
96
- messages: import("..").Message[];
97
- bans: import("..").GuildBan[];
75
+ messages: ReturnManagers['messages'][];
76
+ users: ReturnManagers['users'][];
77
+ guilds: ReturnManagers['guilds'][];
78
+ members: ReturnManagers['members'][];
79
+ voiceStates: ReturnManagers['voiceStates'][];
80
+ emojis: ReturnManagers['emojis'][];
81
+ roles: ReturnManagers['roles'][];
82
+ channels: ReturnManagers['channels'][];
83
+ stickers: ReturnManagers['stickers'][];
84
+ presences: ReturnManagers['presences'][];
85
+ stageInstances: ReturnManagers['stageInstances'][];
86
+ overwrites: ReturnManagers['overwrites'][];
87
+ bans: ReturnManagers['bans'][];
98
88
  }>>;
99
89
  bulkPatch(keys: (readonly [
100
90
  CacheFrom,
@@ -18,18 +18,18 @@ exports.CacheFrom = exports.Cache = exports.GuildRelatedResource = exports.Guild
18
18
  const common_1 = require("../common");
19
19
  const guilds_1 = require("./resources/guilds");
20
20
  const users_1 = require("./resources/users");
21
+ const types_1 = require("../types");
21
22
  const bans_1 = require("./resources/bans");
22
23
  const channels_1 = require("./resources/channels");
23
24
  const emojis_1 = require("./resources/emojis");
24
25
  const members_1 = require("./resources/members");
26
+ const messages_1 = require("./resources/messages");
27
+ const overwrites_1 = require("./resources/overwrites");
25
28
  const presence_1 = require("./resources/presence");
26
29
  const roles_1 = require("./resources/roles");
27
30
  const stage_instances_1 = require("./resources/stage-instances");
28
31
  const stickers_1 = require("./resources/stickers");
29
32
  const voice_states_1 = require("./resources/voice-states");
30
- const types_1 = require("../types");
31
- const messages_1 = require("./resources/messages");
32
- const overwrites_1 = require("./resources/overwrites");
33
33
  var base_1 = require("./resources/default/base");
34
34
  Object.defineProperty(exports, "BaseResource", { enumerable: true, get: function () { return base_1.BaseResource; } });
35
35
  var guild_based_1 = require("./resources/default/guild-based");
@@ -26,7 +26,7 @@ export declare class EntryPointContext<M extends keyof RegisteredMiddlewares = n
26
26
  editResponse(body: InteractionMessageUpdateBodyRequest): Promise<WebhookMessageStructure>;
27
27
  deleteResponse(): Promise<void>;
28
28
  editOrReply<WR extends boolean = false>(body: InteractionCreateBodyRequest | InteractionMessageUpdateBodyRequest, withResponse?: WR): Promise<When<WR, WebhookMessageStructure, void>>;
29
- fetchResponse(): Promise<import("../..").WebhookMessage>;
29
+ fetchResponse(): Promise<WebhookMessageStructure>;
30
30
  channel(mode?: 'rest' | 'flow'): Promise<AllChannels>;
31
31
  channel(mode: 'cache'): ReturnCache<AllChannels>;
32
32
  me(mode?: 'rest' | 'flow'): Promise<GuildMemberStructure>;
@@ -231,7 +231,7 @@ class EventHandler extends common_1.BaseHandler {
231
231
  }
232
232
  }
233
233
  onFile(file) {
234
- return file.default ? [file.default] : undefined;
234
+ return file.default ? (Array.isArray(file.default) ? file.default : [file.default]) : undefined;
235
235
  }
236
236
  callback = (file) => file;
237
237
  }
@@ -2,7 +2,6 @@ import type { GuildMemberStructure } from '../client';
2
2
  import type { UsingClient } from '../commands';
3
3
  import type { ObjectToLower, StructPropState, StructStates, ToClass } from '../common/types/util';
4
4
  import type { APIGuild, APIPartialGuild, GatewayGuildCreateDispatchData, RESTPatchAPIGuildJSONBody } from '../types';
5
- import { GuildMember } from './GuildMember';
6
5
  import { BaseGuild } from './extra/BaseGuild';
7
6
  import type { DiscordBase } from './extra/DiscordBase';
8
7
  export interface Guild extends ObjectToLower<Omit<APIGuild, 'stickers' | 'emojis' | 'roles'>>, DiscordBase {
@@ -41,7 +40,7 @@ export declare class Guild<State extends StructStates = 'api'> extends Guild_bas
41
40
  unban: (id: string, reason?: string) => Promise<never>;
42
41
  ban: (id: string, body?: import("../types").RESTPutAPIGuildBanJSONBody, reason?: string) => Promise<void>;
43
42
  kick: (id: string, reason?: string) => Promise<void>;
44
- edit: (id: string, body: import("../types").RESTPatchAPIGuildMemberJSONBody, reason?: string) => Promise<GuildMember>;
43
+ edit: (id: string, body: import("../types").RESTPatchAPIGuildMemberJSONBody, reason?: string) => Promise<GuildMemberStructure>;
45
44
  add: (id: string, body: import("../types").RESTPutAPIGuildMemberJSONBody) => Promise<GuildMemberStructure | undefined>;
46
45
  addRole: (memberId: string, id: string) => Promise<never>;
47
46
  removeRole: (memberId: string, id: string) => Promise<never>;
@@ -50,7 +50,7 @@ export declare class BaseGuildMember extends DiscordBase {
50
50
  unban: (id: string, reason?: string) => Promise<never>;
51
51
  ban: (id: string, body?: RESTPutAPIGuildBanJSONBody, reason?: string) => Promise<void>;
52
52
  kick: (id: string, reason?: string) => Promise<void>;
53
- edit: (id: string, body: RESTPatchAPIGuildMemberJSONBody, reason?: string) => Promise<GuildMember>;
53
+ edit: (id: string, body: RESTPatchAPIGuildMemberJSONBody, reason?: string) => Promise<GuildMemberStructure>;
54
54
  add: (id: string, body: RESTPutAPIGuildMemberJSONBody) => Promise<GuildMemberStructure | undefined>;
55
55
  addRole: (memberId: string, id: string) => Promise<never>;
56
56
  removeRole: (memberId: string, id: string) => Promise<never>;
@@ -1,6 +1,6 @@
1
1
  import { type APIApplicationCommandAutocompleteInteraction, type APIApplicationCommandInteraction, type APIBaseInteraction, type APIChatInputApplicationCommandInteraction, type APIChatInputApplicationCommandInteractionData, type APICommandAutocompleteInteractionResponseCallbackData, type APIEntryPointCommandInteraction, type APIInteraction, type APIInteractionResponse, type APIInteractionResponseChannelMessageWithSource, type APIInteractionResponseDeferredChannelMessageWithSource, type APIInteractionResponseDeferredMessageUpdate, type APIInteractionResponsePong, type APIInteractionResponseUpdateMessage, type APIMessageApplicationCommandInteraction, type APIMessageApplicationCommandInteractionData, type APIMessageButtonInteractionData, type APIMessageComponentInteraction, type APIMessageComponentSelectMenuInteraction, type APIMessageStringSelectInteractionData, type APIModalSubmission, type APIModalSubmitInteraction, type APIUserApplicationCommandInteraction, type APIUserApplicationCommandInteractionData, ApplicationCommandType, ComponentType, type GatewayInteractionCreateDispatchData, type InteractionCallbackData, type InteractionCallbackResourceActivity, InteractionResponseType, InteractionType, type MessageFlags, type RESTPostAPIInteractionCallbackJSONBody, type RESTPostAPIInteractionCallbackResult } from '../types';
2
2
  import type { RawFile } from '../api';
3
- import { type EntitlementStructure, type GuildRoleStructure, type InteractionGuildMemberStructure, type MessageStructure, type OptionResolverStructure, type UserStructure, type WebhookMessageStructure } from '../client/transformers';
3
+ import { type EntitlementStructure, type GuildRoleStructure, type GuildStructure, type InteractionGuildMemberStructure, type MessageStructure, type OptionResolverStructure, type UserStructure, type WebhookMessageStructure } from '../client/transformers';
4
4
  import type { UsingClient } from '../commands';
5
5
  import { type ComponentInteractionMessageUpdate, type InteractionCreateBodyRequest, type InteractionMessageUpdateBodyRequest, type MessageCreateBodyRequest, type MessageUpdateBodyRequest, type MessageWebhookCreateBodyRequest, type ModalCreateBodyRequest, type ObjectToLower, type OmitInsert, type ToClass, type When } from '../common';
6
6
  import { type AllChannels } from './';
@@ -50,7 +50,7 @@ export declare class BaseInteraction<FromGuild extends boolean = boolean, Type e
50
50
  isModal(): this is ModalSubmitInteraction;
51
51
  isEntryPoint(): this is EntryPointInteraction;
52
52
  static from(client: UsingClient, gateway: GatewayInteractionCreateDispatchData, __reply?: __InternalReplyFunction): RoleSelectMenuInteraction | UserSelectMenuInteraction | MentionableSelectMenuInteraction | ChannelSelectMenuInteraction | ChatInputCommandInteraction<boolean> | UserCommandInteraction<boolean> | MessageCommandInteraction<boolean> | ButtonInteraction | StringSelectMenuInteraction<string[]> | ModalSubmitInteraction<boolean> | AutocompleteInteraction<boolean> | BaseInteraction<boolean, import("../types").APIPingInteraction>;
53
- fetchGuild(force?: boolean): Promise<import("./Guild").Guild<"api"> | undefined>;
53
+ fetchGuild(force?: boolean): Promise<GuildStructure<'api'> | undefined>;
54
54
  }
55
55
  export type AllInteractions = AutocompleteInteraction | ChatInputCommandInteraction | UserCommandInteraction | MessageCommandInteraction | ComponentInteraction | SelectMenuInteraction | ModalSubmitInteraction | EntryPointInteraction | BaseInteraction;
56
56
  export interface AutocompleteInteraction extends ObjectToLower<Omit<APIApplicationCommandAutocompleteInteraction, 'user' | 'member' | 'type' | 'data' | 'message' | 'channel' | 'app_permissions'>> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seyfert",
3
- "version": "2.1.1-dev-12511254197.0",
3
+ "version": "2.1.1-dev-12522165110.0",
4
4
  "description": "The most advanced framework for discord bots",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",