seyfert 1.0.1 → 1.1.1

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.
Files changed (113) hide show
  1. package/lib/api/CDN.d.ts +1 -1
  2. package/lib/api/CDN.js +0 -2
  3. package/lib/api/Router.js +2 -2
  4. package/lib/api/Routes/applications.d.ts +29 -33
  5. package/lib/api/Routes/channels.d.ts +11 -17
  6. package/lib/api/Routes/interactions.d.ts +3 -7
  7. package/lib/api/Routes/webhooks.d.ts +4 -6
  8. package/lib/builders/Attachment.d.ts +2 -3
  9. package/lib/cache/adapters/redis.js +6 -0
  10. package/lib/cache/adapters/types.d.ts +23 -23
  11. package/lib/cache/adapters/workeradapter.d.ts +4 -4
  12. package/lib/cache/adapters/workeradapter.js +10 -5
  13. package/lib/cache/index.d.ts +4 -5
  14. package/lib/cache/index.js +4 -3
  15. package/lib/cache/resources/default/base.d.ts +11 -10
  16. package/lib/cache/resources/default/guild-based.d.ts +8 -7
  17. package/lib/cache/resources/default/guild-based.js +8 -7
  18. package/lib/cache/resources/default/guild-related.d.ts +10 -9
  19. package/lib/cache/resources/default/guild-related.js +3 -2
  20. package/lib/cache/resources/guilds.js +2 -1
  21. package/lib/cache/resources/overwrites.d.ts +1 -1
  22. package/lib/cache/resources/overwrites.js +7 -1
  23. package/lib/client/base.d.ts +33 -179
  24. package/lib/client/base.js +56 -21
  25. package/lib/client/client.d.ts +10 -3
  26. package/lib/client/client.js +23 -8
  27. package/lib/client/oninteractioncreate.js +9 -9
  28. package/lib/client/onmessagecreate.js +192 -153
  29. package/lib/client/workerclient.d.ts +9 -3
  30. package/lib/client/workerclient.js +50 -23
  31. package/lib/collection.js +2 -2
  32. package/lib/commands/applications/chat.d.ts +16 -8
  33. package/lib/commands/applications/chat.js +20 -13
  34. package/lib/commands/applications/chatcontext.d.ts +6 -4
  35. package/lib/commands/applications/chatcontext.js +6 -1
  36. package/lib/commands/applications/menu.d.ts +5 -1
  37. package/lib/commands/applications/menu.js +11 -5
  38. package/lib/commands/applications/menucontext.d.ts +5 -3
  39. package/lib/commands/applications/menucontext.js +7 -2
  40. package/lib/commands/applications/options.d.ts +1 -2
  41. package/lib/commands/applications/shared.d.ts +5 -4
  42. package/lib/commands/decorators.d.ts +18 -6
  43. package/lib/commands/decorators.js +18 -8
  44. package/lib/commands/handler.d.ts +11 -5
  45. package/lib/commands/handler.js +46 -37
  46. package/lib/commands/optionresolver.d.ts +11 -4
  47. package/lib/commands/optionresolver.js +6 -4
  48. package/lib/common/index.d.ts +7 -0
  49. package/lib/common/index.js +7 -0
  50. package/lib/common/it/utils.d.ts +1 -0
  51. package/lib/common/it/utils.js +4 -1
  52. package/lib/common/shorters/channels.d.ts +67 -129
  53. package/lib/common/shorters/channels.js +119 -135
  54. package/lib/common/shorters/emojis.d.ts +47 -0
  55. package/lib/common/shorters/emojis.js +80 -0
  56. package/lib/common/shorters/guilds.d.ts +22 -249
  57. package/lib/common/shorters/guilds.js +51 -140
  58. package/lib/common/shorters/members.d.ts +82 -108
  59. package/lib/common/shorters/members.js +151 -166
  60. package/lib/common/shorters/messages.d.ts +11 -23
  61. package/lib/common/shorters/messages.js +58 -104
  62. package/lib/common/shorters/reactions.d.ts +10 -0
  63. package/lib/common/shorters/reactions.js +45 -0
  64. package/lib/common/shorters/roles.d.ts +39 -7
  65. package/lib/common/shorters/roles.js +74 -42
  66. package/lib/common/shorters/templates.d.ts +6 -8
  67. package/lib/common/shorters/templates.js +17 -21
  68. package/lib/common/shorters/users.d.ts +4 -6
  69. package/lib/common/shorters/users.js +29 -33
  70. package/lib/common/shorters/webhook.d.ts +62 -26
  71. package/lib/common/shorters/webhook.js +113 -58
  72. package/lib/common/types/options.d.ts +2 -2
  73. package/lib/common/types/util.d.ts +3 -0
  74. package/lib/components/handler.d.ts +28 -9
  75. package/lib/components/handler.js +28 -11
  76. package/lib/events/handler.d.ts +10 -2
  77. package/lib/events/handler.js +6 -8
  78. package/lib/index.d.ts +4 -2
  79. package/lib/index.js +1 -1
  80. package/lib/langs/handler.d.ts +8 -0
  81. package/lib/langs/handler.js +8 -2
  82. package/lib/structures/AutoModerationRule.d.ts +2 -2
  83. package/lib/structures/ClientUser.d.ts +2 -2
  84. package/lib/structures/Guild.d.ts +2 -2
  85. package/lib/structures/GuildEmoji.d.ts +4 -4
  86. package/lib/structures/GuildEmoji.js +7 -7
  87. package/lib/structures/GuildMember.d.ts +7 -6
  88. package/lib/structures/GuildMember.js +5 -2
  89. package/lib/structures/GuildPreview.d.ts +2 -2
  90. package/lib/structures/GuildRole.d.ts +2 -2
  91. package/lib/structures/GuildTemplate.d.ts +2 -2
  92. package/lib/structures/Interaction.d.ts +9 -10
  93. package/lib/structures/Interaction.js +2 -2
  94. package/lib/structures/Message.d.ts +8 -7
  95. package/lib/structures/Message.js +7 -4
  96. package/lib/structures/Sticker.d.ts +2 -2
  97. package/lib/structures/User.d.ts +1 -0
  98. package/lib/structures/User.js +5 -0
  99. package/lib/structures/Webhook.d.ts +2 -2
  100. package/lib/structures/Webhook.js +3 -3
  101. package/lib/structures/channels.d.ts +21 -22
  102. package/lib/structures/channels.js +13 -25
  103. package/lib/structures/extra/Base.d.ts +1 -2
  104. package/lib/structures/extra/DiscordBase.d.ts +2 -2
  105. package/lib/websocket/constants/index.js +1 -0
  106. package/lib/websocket/discord/shard.js +4 -2
  107. package/lib/websocket/discord/sharder.d.ts +3 -0
  108. package/lib/websocket/discord/sharder.js +12 -5
  109. package/lib/websocket/discord/shared.d.ts +1 -0
  110. package/lib/websocket/discord/worker.d.ts +2 -1
  111. package/lib/websocket/discord/workermanager.d.ts +8 -3
  112. package/lib/websocket/discord/workermanager.js +78 -30
  113. package/package.json +8 -6
@@ -1,10 +1,10 @@
1
- import type { BaseClient } from '../client/base';
1
+ import type { UsingClient } from '../commands';
2
2
  import type { GatewayReadyDispatchData, RESTPatchAPICurrentUserJSONBody } from '../common';
3
3
  import { User } from './User';
4
4
  export declare class ClientUser extends User {
5
5
  application: GatewayReadyDispatchData['application'];
6
6
  bot: boolean;
7
- constructor(client: BaseClient, data: GatewayReadyDispatchData['user'], application: GatewayReadyDispatchData['application']);
7
+ constructor(client: UsingClient, data: GatewayReadyDispatchData['user'], application: GatewayReadyDispatchData['application']);
8
8
  fetch(): Promise<ClientUser>;
9
9
  edit(body: RESTPatchAPICurrentUserJSONBody): Promise<ClientUser>;
10
10
  }
@@ -1,4 +1,4 @@
1
- import type { BaseClient } from '../client/base';
1
+ import type { UsingClient } from '../commands';
2
2
  import type { APIGuild, GatewayGuildCreateDispatchData, ObjectToLower } from '../common';
3
3
  import type { StructPropState, StructStates, ToClass } from '../common/types/util';
4
4
  import { GuildEmoji } from './GuildEmoji';
@@ -15,7 +15,7 @@ export declare class Guild<State extends StructStates = 'api'> extends Guild_bas
15
15
  memberCount: StructPropState<number, State, 'create'>;
16
16
  large: StructPropState<boolean, State, 'create'>;
17
17
  unavailable?: StructPropState<boolean, State, 'create'>;
18
- constructor(client: BaseClient, data: APIGuild | GatewayGuildCreateDispatchData);
18
+ constructor(client: UsingClient, data: APIGuild | GatewayGuildCreateDispatchData);
19
19
  webhooks: {
20
20
  list: () => Promise<import("./Webhook").Webhook[]>;
21
21
  };
@@ -1,12 +1,12 @@
1
1
  import type { BaseImageURLOptions } from '../api';
2
- import type { BaseClient } from '../client/base';
3
- import type { APIEmoji, GuildShorter, MethodContext, ObjectToLower, RESTPatchAPIChannelJSONBody, RESTPatchAPIGuildEmojiJSONBody } from '../common';
2
+ import type { UsingClient } from '../commands';
3
+ import type { APIEmoji, EmojiShorter, MethodContext, ObjectToLower, RESTPatchAPIChannelJSONBody, RESTPatchAPIGuildEmojiJSONBody } from '../common';
4
4
  import { DiscordBase } from './extra/DiscordBase';
5
5
  export interface GuildEmoji extends DiscordBase, ObjectToLower<Omit<APIEmoji, 'id'>> {
6
6
  }
7
7
  export declare class GuildEmoji extends DiscordBase {
8
8
  readonly guildId: string;
9
- constructor(client: BaseClient, data: APIEmoji, guildId: string);
9
+ constructor(client: UsingClient, data: APIEmoji, guildId: string);
10
10
  guild(force?: boolean): Promise<import("./Guild").Guild<"cached"> | import("./Guild").Guild<"api">> | undefined;
11
11
  edit(body: RESTPatchAPIChannelJSONBody, reason?: string): Promise<GuildEmoji>;
12
12
  delete(reason?: string): Promise<void>;
@@ -22,7 +22,7 @@ export declare class GuildEmoji extends DiscordBase {
22
22
  guildId: string;
23
23
  }>): {
24
24
  edit: (emojiId: string, body: RESTPatchAPIGuildEmojiJSONBody, reason?: string) => Promise<GuildEmoji>;
25
- create: (body: Parameters<GuildShorter['emojis']['create']>[1]) => Promise<void>;
25
+ create: (body: Parameters<EmojiShorter['create']>[1]) => Promise<void>;
26
26
  fetch: (emojiId: string, force?: boolean) => Promise<GuildEmoji>;
27
27
  list: (force?: boolean) => Promise<GuildEmoji[]>;
28
28
  };
@@ -14,13 +14,13 @@ class GuildEmoji extends DiscordBase_1.DiscordBase {
14
14
  return this.client.guilds.fetch(this.guildId, force);
15
15
  }
16
16
  edit(body, reason) {
17
- return this.client.guilds.emojis.edit(this.guildId, this.id, body, reason);
17
+ return this.client.emojis.edit(this.guildId, this.id, body, reason);
18
18
  }
19
19
  delete(reason) {
20
- return this.client.guilds.emojis.delete(this.guildId, this.id, reason);
20
+ return this.client.emojis.delete(this.guildId, this.id, reason);
21
21
  }
22
22
  fetch(force = false) {
23
- return this.client.guilds.emojis.fetch(this.guildId, this.id, force);
23
+ return this.client.emojis.fetch(this.guildId, this.id, force);
24
24
  }
25
25
  url(options) {
26
26
  return this.rest.cdn.emoji(this.id, options);
@@ -37,10 +37,10 @@ class GuildEmoji extends DiscordBase_1.DiscordBase {
37
37
  }
38
38
  static methods({ client, guildId }) {
39
39
  return {
40
- edit: (emojiId, body, reason) => client.guilds.emojis.edit(guildId, emojiId, body, reason),
41
- create: (body) => client.guilds.emojis.create(guildId, body),
42
- fetch: (emojiId, force = false) => client.guilds.emojis.fetch(guildId, emojiId, force),
43
- list: (force = false) => client.guilds.emojis.list(guildId, force),
40
+ edit: (emojiId, body, reason) => client.emojis.edit(guildId, emojiId, body, reason),
41
+ create: (body) => client.emojis.create(guildId, body),
42
+ fetch: (emojiId, force = false) => client.emojis.fetch(guildId, emojiId, force),
43
+ list: (force = false) => client.emojis.list(guildId, force),
44
44
  };
45
45
  }
46
46
  }
@@ -1,7 +1,7 @@
1
1
  import type { APIGuildMember, APIInteractionDataResolvedGuildMember, APIUser, GatewayGuildMemberAddDispatchData, GatewayGuildMemberUpdateDispatchData, MakeRequired, MessageCreateBodyRequest, ObjectToLower, RESTGetAPIGuildMembersQuery, RESTGetAPIGuildMembersSearchQuery, RESTPatchAPIGuildMemberJSONBody, RESTPutAPIGuildBanJSONBody, RESTPutAPIGuildMemberJSONBody, ToClass } from '../common';
2
2
  import { DiscordBase } from './extra/DiscordBase';
3
3
  export type GuildMemberData = APIGuildMember | GatewayGuildMemberUpdateDispatchData | GatewayGuildMemberAddDispatchData | APIInteractionDataResolvedGuildMember;
4
- import type { BaseClient } from '../client/base';
4
+ import type { UsingClient } from '../commands';
5
5
  import type { ImageOptions, MethodContext } from '../common/types/options';
6
6
  import type { GuildMemberResolvable } from '../common/types/resolvables';
7
7
  import { User } from './User';
@@ -17,7 +17,7 @@ export declare class BaseGuildMember extends DiscordBase {
17
17
  private _roles;
18
18
  joinedTimestamp?: number;
19
19
  communicationDisabledUntilTimestamp?: number | null;
20
- constructor(client: BaseClient, data: GuildMemberData, id: string,
20
+ constructor(client: UsingClient, data: GuildMemberData, id: string,
21
21
  /** the choosen guild id */
22
22
  guildId: string);
23
23
  guild(force?: boolean): Promise<import("./Guild").Guild<"cached"> | import("./Guild").Guild<"api">>;
@@ -39,8 +39,8 @@ export declare class BaseGuildMember extends DiscordBase {
39
39
  private patch;
40
40
  get roles(): {
41
41
  values: readonly string[];
42
- add: (id: string) => Promise<void>;
43
- remove: (id: string) => Promise<void>;
42
+ add: (id: string) => void;
43
+ remove: (id: string) => Promise<never>;
44
44
  permissions: () => Promise<PermissionsBitField>;
45
45
  };
46
46
  static methods({ client, guildId }: MethodContext<{
@@ -67,7 +67,7 @@ export declare class GuildMember extends BaseGuildMember {
67
67
  /** the choosen guild id */
68
68
  readonly guildId: string;
69
69
  user: User;
70
- constructor(client: BaseClient, data: GuildMemberData, user: APIUser | User,
70
+ constructor(client: UsingClient, data: GuildMemberData, user: APIUser | User,
71
71
  /** the choosen guild id */
72
72
  guildId: string);
73
73
  get tag(): string;
@@ -81,6 +81,7 @@ export declare class GuildMember extends BaseGuildMember {
81
81
  write(body: MessageCreateBodyRequest): Promise<import("./Message").Message>;
82
82
  avatarURL(options?: ImageOptions): string;
83
83
  dynamicAvatarURL(options?: ImageOptions): string;
84
+ bannerURL(options?: ImageOptions): string | undefined;
84
85
  fetchPermissions(): Promise<PermissionsBitField>;
85
86
  }
86
87
  export interface UnavailableMember {
@@ -97,7 +98,7 @@ declare const InteractionGuildMember_base: ToClass<Omit<GuildMember, "deaf" | "m
97
98
  */
98
99
  export declare class InteractionGuildMember extends InteractionGuildMember_base {
99
100
  permissions: PermissionsBitField;
100
- constructor(client: BaseClient, data: APIInteractionDataResolvedGuildMember, user: APIUser | User,
101
+ constructor(client: UsingClient, data: APIInteractionDataResolvedGuildMember, user: APIUser | User,
101
102
  /** the choosen guild id */
102
103
  guildId: string);
103
104
  }
@@ -55,8 +55,8 @@ class BaseGuildMember extends DiscordBase_1.DiscordBase {
55
55
  get roles() {
56
56
  return {
57
57
  values: Object.freeze(this._roles),
58
- add: (id) => this.client.members.roles.add(this.guildId, this.id, id),
59
- remove: (id) => this.client.members.roles.remove(this.guildId, this.id, id),
58
+ add: (id) => this.client.members.addRole(this.guildId, this.id, id),
59
+ remove: (id) => this.client.members.removeRole(this.guildId, this.id, id),
60
60
  permissions: async () => new Permissions_1.PermissionsBitField(((await this.cache.roles?.bulk(this.roles.values)) ?? [])
61
61
  .filter(x => x)
62
62
  .map(x => BigInt(x.permissions.bits))),
@@ -125,6 +125,9 @@ class GuildMember extends BaseGuildMember {
125
125
  }
126
126
  return this.rest.cdn.guildMemberAvatar(this.guildId, this.id, this.avatar, options);
127
127
  }
128
+ bannerURL(options) {
129
+ return this.user.bannerURL(options);
130
+ }
128
131
  async fetchPermissions() {
129
132
  if ('permissions' in this)
130
133
  return this.permissions;
@@ -1,4 +1,4 @@
1
- import type { BaseClient } from '../client/base';
1
+ import type { UsingClient } from '../commands';
2
2
  import type { APIGuildPreview } from '../common';
3
3
  import { AnonymousGuild } from './AnonymousGuild';
4
4
  /**
@@ -6,5 +6,5 @@ import { AnonymousGuild } from './AnonymousGuild';
6
6
  * @link https://discord.com/developers/docs/resources/guild#guild-preview-object
7
7
  */
8
8
  export declare class GuildPreview extends AnonymousGuild {
9
- constructor(client: BaseClient, data: APIGuildPreview);
9
+ constructor(client: UsingClient, data: APIGuildPreview);
10
10
  }
@@ -1,4 +1,4 @@
1
- import type { BaseClient } from '../client/base';
1
+ import type { UsingClient } from '../commands';
2
2
  import type { APIRole, MethodContext, ObjectToLower, RESTPatchAPIGuildRoleJSONBody, RESTPatchAPIGuildRolePositionsJSONBody, RESTPostAPIGuildRoleJSONBody } from '../common';
3
3
  import { DiscordBase } from './extra/DiscordBase';
4
4
  import { PermissionsBitField } from './extra/Permissions';
@@ -7,7 +7,7 @@ export interface GuildRole extends DiscordBase, ObjectToLower<Omit<APIRole, 'per
7
7
  export declare class GuildRole extends DiscordBase {
8
8
  readonly guildId: string;
9
9
  permissions: PermissionsBitField;
10
- constructor(client: BaseClient, data: APIRole, guildId: string);
10
+ constructor(client: UsingClient, data: APIRole, guildId: string);
11
11
  guild(force?: boolean): Promise<import("./Guild").Guild<"cached"> | import("./Guild").Guild<"api">> | undefined;
12
12
  edit(body: RESTPatchAPIGuildRoleJSONBody, reason?: string): Promise<any>;
13
13
  delete(reason?: string): Promise<void | undefined>;
@@ -1,10 +1,10 @@
1
- import type { BaseClient } from '../client/base';
1
+ import type { UsingClient } from '../commands';
2
2
  import type { APITemplate, MethodContext, ObjectToLower, RESTPatchAPIGuildTemplateJSONBody, RESTPostAPIGuildTemplatesJSONBody } from '../common';
3
3
  import { Base } from './extra/Base';
4
4
  export interface GuildTemplate extends Base, ObjectToLower<APITemplate> {
5
5
  }
6
6
  export declare class GuildTemplate extends Base {
7
- constructor(client: BaseClient, data: APITemplate);
7
+ constructor(client: UsingClient, data: APITemplate);
8
8
  guild(force?: boolean): Promise<import("./Guild").Guild<"cached"> | import("./Guild").Guild<"api">>;
9
9
  fetch(): Promise<APITemplate>;
10
10
  sync(): Promise<APITemplate>;
@@ -1,4 +1,3 @@
1
- import type { BaseClient } from '../client/base';
2
1
  import { OptionResolver, type UsingClient } from '../commands';
3
2
  import type { APIApplicationCommandAutocompleteInteraction, APIApplicationCommandInteraction, APIBaseInteraction, APIChatInputApplicationCommandInteraction, APIChatInputApplicationCommandInteractionData, APICommandAutocompleteInteractionResponseCallbackData, APIInteraction, APIInteractionResponse, APIInteractionResponseChannelMessageWithSource, APIInteractionResponseDeferredChannelMessageWithSource, APIInteractionResponseDeferredMessageUpdate, APIInteractionResponsePong, APIInteractionResponseUpdateMessage, APIMessageApplicationCommandInteraction, APIMessageApplicationCommandInteractionData, APIMessageButtonInteractionData, APIMessageComponentInteraction, APIMessageComponentSelectMenuInteraction, APIMessageStringSelectInteractionData, APIModalSubmission, APIModalSubmitInteraction, APIUserApplicationCommandInteraction, APIUserApplicationCommandInteractionData, GatewayInteractionCreateDispatchData, MessageFlags, ObjectToLower, OmitInsert, RESTPostAPIInteractionCallbackJSONBody, ToClass, When } from '../common';
4
3
  import { ApplicationCommandType, ComponentType, InteractionResponseType, InteractionType } from '../common';
@@ -33,7 +32,7 @@ export declare class BaseInteraction<FromGuild extends boolean = boolean, Type e
33
32
  private matchReplied;
34
33
  reply(body: ReplyInteractionBody): Promise<void>;
35
34
  deferReply(flags?: MessageFlags): Promise<void>;
36
- static from(client: BaseClient, gateway: GatewayInteractionCreateDispatchData, __reply?: __InternalReplyFunction): StringSelectMenuInteraction<string[]> | AutocompleteInteraction<boolean> | BaseInteraction<boolean, import("discord-api-types/payloads/v10/_interactions/ping").APIPingInteraction>;
35
+ static from(client: UsingClient, gateway: GatewayInteractionCreateDispatchData, __reply?: __InternalReplyFunction): StringSelectMenuInteraction<string[]> | AutocompleteInteraction<boolean> | BaseInteraction<boolean, import("discord-api-types/payloads/v10/_interactions/ping").APIPingInteraction>;
37
36
  fetchGuild(force?: boolean): Promise<import("./Guild").Guild<"cached"> | import("./Guild").Guild<"api">> | undefined;
38
37
  }
39
38
  export type AllInteractions = AutocompleteInteraction | ChatInputCommandInteraction | UserCommandInteraction | MessageCommandInteraction | ComponentInteraction | SelectMenuInteraction | ModalSubmitInteraction | BaseInteraction;
@@ -44,7 +43,7 @@ export declare class AutocompleteInteraction<FromGuild extends boolean = boolean
44
43
  type: InteractionType.ApplicationCommandAutocomplete;
45
44
  data: ObjectToLower<APIApplicationCommandAutocompleteInteraction['data']>;
46
45
  options: OptionResolver;
47
- constructor(client: BaseClient, interaction: APIApplicationCommandAutocompleteInteraction, __reply?: __InternalReplyFunction | undefined);
46
+ constructor(client: UsingClient, interaction: APIApplicationCommandAutocompleteInteraction, __reply?: __InternalReplyFunction | undefined);
48
47
  getInput(): string;
49
48
  respond(choices: APICommandAutocompleteInteractionResponseCallbackData['choices']): Promise<void>;
50
49
  /** @intenal */
@@ -58,8 +57,8 @@ export declare class Interaction<FromGuild extends boolean = boolean, Type exten
58
57
  editOrReply<FR extends boolean = false>(body: InteractionCreateBodyRequest, fetchReply?: FR): Promise<When<FR, WebhookMessage, void>>;
59
58
  editMessage(messageId: string, body: InteractionMessageUpdateBodyRequest): Promise<Message>;
60
59
  editResponse(body: InteractionMessageUpdateBodyRequest): Promise<Message>;
61
- deleteResponse(): Promise<void>;
62
- deleteMessage(messageId: string): Promise<void>;
60
+ deleteResponse(): Promise<void | undefined>;
61
+ deleteMessage(messageId: string): Promise<void | undefined>;
63
62
  createResponse({ files, ...body }: MessageWebhookCreateBodyRequest): Promise<Message>;
64
63
  }
65
64
  export declare class ApplicationCommandInteraction<FromGuild extends boolean = boolean, Type extends APIApplicationCommandInteraction = APIApplicationCommandInteraction> extends Interaction<FromGuild, Type> {
@@ -91,7 +90,7 @@ export declare class ButtonInteraction extends ComponentInteraction {
91
90
  export declare class SelectMenuInteraction extends ComponentInteraction {
92
91
  protected __reply?: __InternalReplyFunction | undefined;
93
92
  data: ObjectToLower<APIMessageComponentSelectMenuInteraction['data']>;
94
- constructor(client: BaseClient, interaction: APIMessageComponentSelectMenuInteraction, __reply?: __InternalReplyFunction | undefined);
93
+ constructor(client: UsingClient, interaction: APIMessageComponentSelectMenuInteraction, __reply?: __InternalReplyFunction | undefined);
95
94
  get values(): string[];
96
95
  }
97
96
  declare const StringSelectMenuInteraction_base: ToClass<Omit<SelectMenuInteraction, "data">, StringSelectMenuInteraction<string[]>>;
@@ -104,25 +103,25 @@ export declare class StringSelectMenuInteraction<T extends any[] = string[]> ext
104
103
  export declare class ChannelSelectMenuInteraction extends SelectMenuInteraction {
105
104
  protected __reply?: __InternalReplyFunction | undefined;
106
105
  channels: AllChannels[];
107
- constructor(client: BaseClient, interaction: APIMessageComponentSelectMenuInteraction, __reply?: __InternalReplyFunction | undefined);
106
+ constructor(client: UsingClient, interaction: APIMessageComponentSelectMenuInteraction, __reply?: __InternalReplyFunction | undefined);
108
107
  }
109
108
  export declare class MentionableSelectMenuInteraction extends SelectMenuInteraction {
110
109
  protected __reply?: __InternalReplyFunction | undefined;
111
110
  roles: GuildRole[];
112
111
  members: InteractionGuildMember[];
113
112
  users: User[];
114
- constructor(client: BaseClient, interaction: APIMessageComponentSelectMenuInteraction, __reply?: __InternalReplyFunction | undefined);
113
+ constructor(client: UsingClient, interaction: APIMessageComponentSelectMenuInteraction, __reply?: __InternalReplyFunction | undefined);
115
114
  }
116
115
  export declare class RoleSelectMenuInteraction extends SelectMenuInteraction {
117
116
  protected __reply?: __InternalReplyFunction | undefined;
118
117
  roles: GuildRole[];
119
- constructor(client: BaseClient, interaction: APIMessageComponentSelectMenuInteraction, __reply?: __InternalReplyFunction | undefined);
118
+ constructor(client: UsingClient, interaction: APIMessageComponentSelectMenuInteraction, __reply?: __InternalReplyFunction | undefined);
120
119
  }
121
120
  export declare class UserSelectMenuInteraction extends SelectMenuInteraction {
122
121
  protected __reply?: __InternalReplyFunction | undefined;
123
122
  members: InteractionGuildMember[];
124
123
  users: User[];
125
- constructor(client: BaseClient, interaction: APIMessageComponentSelectMenuInteraction, __reply?: __InternalReplyFunction | undefined);
124
+ constructor(client: UsingClient, interaction: APIMessageComponentSelectMenuInteraction, __reply?: __InternalReplyFunction | undefined);
126
125
  }
127
126
  export declare class ChatInputCommandInteraction<FromGuild extends boolean = boolean> extends ApplicationCommandInteraction<FromGuild, APIChatInputApplicationCommandInteraction> {
128
127
  data: ObjectToLower<APIChatInputApplicationCommandInteractionData>;
@@ -191,7 +191,7 @@ class AutocompleteInteraction extends BaseInteraction {
191
191
  exports.AutocompleteInteraction = AutocompleteInteraction;
192
192
  class Interaction extends BaseInteraction {
193
193
  fetchMessage(messageId) {
194
- return this.client.webhooks.messages.fetch(this.applicationId, this.token, messageId);
194
+ return this.client.webhooks.fetchMessage(this.applicationId, this.token, messageId);
195
195
  }
196
196
  fetchResponse() {
197
197
  return this.fetchMessage('@original');
@@ -240,7 +240,7 @@ class Interaction extends BaseInteraction {
240
240
  .webhooks(this.applicationId)(this.token)
241
241
  .messages(messageId)
242
242
  .delete()
243
- .then(() => this.client.components.onMessageDelete(messageId === '@original' ? this.id : messageId));
243
+ .then(() => this.client.components?.onMessageDelete(messageId === '@original' ? this.id : messageId));
244
244
  }
245
245
  async createResponse({ files, ...body }) {
246
246
  files ??= files ? await (0, builders_1.resolveFiles)(files) : undefined;
@@ -1,5 +1,5 @@
1
1
  import type { ListenerOptions } from '../builders';
2
- import type { BaseClient } from '../client/base';
2
+ import type { UsingClient } from '../commands';
3
3
  import type { APIChannelMention, APIMessage, GatewayMessageCreateDispatchData, ObjectToLower } from '../common';
4
4
  import type { EmojiResolvable } from '../common/types/resolvables';
5
5
  import type { MessageCreateBodyRequest, MessageUpdateBodyRequest } from '../common/types/write';
@@ -23,26 +23,27 @@ export declare class BaseMessage extends DiscordBase {
23
23
  channels: APIChannelMention[];
24
24
  users: (GuildMember | User)[];
25
25
  };
26
- constructor(client: BaseClient, data: MessageData);
26
+ constructor(client: UsingClient, data: MessageData);
27
+ get user(): User;
27
28
  createComponentCollector(options?: ListenerOptions): {
28
- run: (customId: string, callback: import("../builders").ComponentCallback) => any;
29
+ run: (customId: string | RegExp | string[], callback: import("../builders").ComponentCallback) => any;
29
30
  stop: (reason?: string | undefined) => void;
30
31
  };
31
32
  get url(): string;
32
33
  guild(force?: boolean): Promise<import("./Guild").Guild<"cached"> | import("./Guild").Guild<"api">> | undefined;
33
34
  channel(force?: boolean): Promise<import("./channels").AllChannels>;
34
- react(emoji: EmojiResolvable): Promise<never>;
35
+ react(emoji: EmojiResolvable): Promise<void>;
35
36
  private patch;
36
37
  }
37
38
  export interface Message extends BaseMessage, ObjectToLower<Omit<MessageData, 'timestamp' | 'author' | 'mentions' | 'components'>> {
38
39
  }
39
40
  export declare class Message extends BaseMessage {
40
- constructor(client: BaseClient, data: MessageData);
41
+ constructor(client: UsingClient, data: MessageData);
41
42
  fetch(): Promise<Message>;
42
43
  reply(body: Omit<MessageCreateBodyRequest, 'message_reference'>, fail?: boolean): Promise<Message>;
43
44
  edit(body: MessageUpdateBodyRequest): Promise<Message>;
44
45
  write(body: MessageCreateBodyRequest): Promise<Message>;
45
- delete(reason?: string): Promise<void>;
46
+ delete(reason?: string): Promise<void | undefined>;
46
47
  crosspost(reason?: string): Promise<Message>;
47
48
  }
48
49
  export type EditMessageWebhook = Omit<MessageWebhookMethodEditParams, 'messageId'>;
@@ -50,7 +51,7 @@ export type WriteMessageWebhook = MessageWebhookMethodWriteParams;
50
51
  export declare class WebhookMessage extends BaseMessage {
51
52
  readonly webhookId: string;
52
53
  readonly webhookToken: string;
53
- constructor(client: BaseClient, data: MessageData, webhookId: string, webhookToken: string);
54
+ constructor(client: UsingClient, data: MessageData, webhookId: string, webhookToken: string);
54
55
  fetch(): Promise<import("discord-api-types/rest/v10/webhook").RESTGetAPIWebhookWithTokenResult>;
55
56
  edit(body: EditMessageWebhook): Promise<WebhookMessage>;
56
57
  write(body: WriteMessageWebhook): Promise<WebhookMessage | null>;
@@ -23,6 +23,9 @@ class BaseMessage extends DiscordBase_1.DiscordBase {
23
23
  this.components = data.components?.map(x => new ActionRow_1.MessageActionRowComponent(x)) ?? [];
24
24
  this.patch(data);
25
25
  }
26
+ get user() {
27
+ return this.author;
28
+ }
26
29
  createComponentCollector(options) {
27
30
  return this.client.components.createComponentCollector(this.id, options);
28
31
  }
@@ -38,7 +41,7 @@ class BaseMessage extends DiscordBase_1.DiscordBase {
38
41
  return this.client.channels.fetch(this.channelId, force);
39
42
  }
40
43
  react(emoji) {
41
- return this.client.messages.reactions.add(this.id, this.channelId, emoji);
44
+ return this.client.reactions.add(this.id, this.channelId, emoji);
42
45
  }
43
46
  patch(data) {
44
47
  if ('guild_id' in data) {
@@ -114,13 +117,13 @@ class WebhookMessage extends BaseMessage {
114
117
  return this.api.webhooks(this.webhookId)(this.webhookToken).get({ query: this.thread?.id });
115
118
  }
116
119
  edit(body) {
117
- return this.client.webhooks.messages.edit(this.webhookId, this.webhookToken, { ...body, messageId: this.id });
120
+ return this.client.webhooks.editMessage(this.webhookId, this.webhookToken, { ...body, messageId: this.id });
118
121
  }
119
122
  write(body) {
120
- return this.client.webhooks.messages.write(this.webhookId, this.webhookToken, body);
123
+ return this.client.webhooks.writeMessage(this.webhookId, this.webhookToken, body);
121
124
  }
122
125
  delete(reason) {
123
- return this.client.webhooks.messages.delete(this.webhookId, this.webhookToken, this.id, reason);
126
+ return this.client.webhooks.deleteMessage(this.webhookId, this.webhookToken, this.id, reason);
124
127
  }
125
128
  }
126
129
  exports.WebhookMessage = WebhookMessage;
@@ -1,5 +1,5 @@
1
+ import type { UsingClient } from '..';
1
2
  import type { Attachment } from '../builders';
2
- import type { BaseClient } from '../client/base';
3
3
  import type { APISticker, MethodContext, ObjectToLower, RESTPatchAPIGuildStickerJSONBody, RESTPostAPIGuildStickerFormDataBody } from '../common';
4
4
  import { User } from './User';
5
5
  import { DiscordBase } from './extra/DiscordBase';
@@ -7,7 +7,7 @@ export interface Sticker extends DiscordBase, ObjectToLower<Omit<APISticker, 'us
7
7
  }
8
8
  export declare class Sticker extends DiscordBase {
9
9
  user?: User;
10
- constructor(client: BaseClient, data: APISticker);
10
+ constructor(client: UsingClient, data: APISticker);
11
11
  guild(force?: boolean): Promise<import("./Guild").Guild<"cached"> | import("./Guild").Guild<"api">> | undefined;
12
12
  edit(body: RESTPatchAPIGuildStickerJSONBody, reason?: string): Promise<Sticker> | undefined;
13
13
  fetch(force?: boolean): Promise<Sticker> | undefined;
@@ -16,6 +16,7 @@ export declare class User extends DiscordBase<APIUser> {
16
16
  dm(force?: boolean): Promise<import("./channels").DMChannel>;
17
17
  write(body: MessageCreateBodyRequest): Promise<import("./Message").Message>;
18
18
  avatarURL(options?: ImageOptions): string;
19
+ bannerURL(options?: ImageOptions): string | undefined;
19
20
  presence(): import("..").ReturnCache<(Omit<import("discord-api-types/payloads/v10/gateway").GatewayPresenceUpdate, "user"> & {
20
21
  id: string;
21
22
  } & {
@@ -30,6 +30,11 @@ class User extends DiscordBase_1.DiscordBase {
30
30
  }
31
31
  return this.rest.cdn.avatar(this.id, this.avatar, options);
32
32
  }
33
+ bannerURL(options) {
34
+ if (!this.banner)
35
+ return;
36
+ return this.rest.cdn.banner(this.id, this.banner, options);
37
+ }
33
38
  presence() {
34
39
  return this.cache.presences?.get(this.id);
35
40
  }
@@ -1,4 +1,4 @@
1
- import type { BaseClient } from '../client/base';
1
+ import type { UsingClient } from '../commands';
2
2
  import type { APIWebhook, ImageOptions, MessageWebhookCreateBodyRequest, MessageWebhookPayload, MessageWebhookUpdateBodyRequest, MethodContext, ObjectToLower, RESTGetAPIWebhookWithTokenMessageQuery, RESTPatchAPIWebhookJSONBody, RESTPatchAPIWebhookWithTokenJSONBody, RESTPostAPIWebhookWithTokenQuery } from '../common';
3
3
  import { AnonymousGuild } from './AnonymousGuild';
4
4
  import { User } from './User';
@@ -9,7 +9,7 @@ export declare class Webhook extends DiscordBase {
9
9
  user?: User;
10
10
  sourceGuild?: Partial<AnonymousGuild>;
11
11
  messages: ReturnType<typeof Webhook.messages>;
12
- constructor(client: BaseClient, data: APIWebhook);
12
+ constructor(client: UsingClient, data: APIWebhook);
13
13
  guild(force?: boolean): Promise<import("./Guild").Guild<"cached"> | import("./Guild").Guild<"api">> | undefined;
14
14
  channel(force?: boolean): Promise<import("./channels").BaseChannel<import("discord-api-types/payloads/v10/channel").ChannelType> | import("./channels").DMChannel | import("./channels").CategoryChannel | undefined>;
15
15
  avatarURL(options?: ImageOptions): string | null;
@@ -47,9 +47,9 @@ class Webhook extends DiscordBase_1.DiscordBase {
47
47
  }
48
48
  static messages({ client, webhookId, webhookToken }) {
49
49
  return {
50
- write: (payload) => client.webhooks.messages.write(webhookId, webhookToken, payload),
51
- edit: (payload) => client.webhooks.messages.edit(webhookId, webhookToken, payload),
52
- delete: (messageId, reason) => client.webhooks.messages.delete(webhookId, webhookToken, messageId, reason),
50
+ write: (payload) => client.webhooks.writeMessage(webhookId, webhookToken, payload),
51
+ edit: (payload) => client.webhooks.editMessage(webhookId, webhookToken, payload),
52
+ delete: (messageId, reason) => client.webhooks.deleteMessage(webhookId, webhookToken, messageId, reason),
53
53
  };
54
54
  }
55
55
  static methods({ client, webhookId, webhookToken }) {
@@ -1,13 +1,12 @@
1
1
  import { ChannelType, VideoQualityMode, type APIDMChannel, type APIGuildCategoryChannel, type APIGuildForumChannel, type APIGuildMediaChannel, type APIGuildStageVoiceChannel, type APIGuildVoiceChannel, type APINewsChannel, type APITextChannel, type APIThreadChannel, type ThreadAutoArchiveDuration } from 'discord-api-types/v10';
2
- import type { BaseClient } from '../client/base';
2
+ import type { UsingClient } from '../commands';
3
3
  import type { APIChannelBase, APIGuildChannel, APIGuildForumDefaultReactionEmoji, APIGuildForumTag, EmojiResolvable, MessageCreateBodyRequest, MessageUpdateBodyRequest, MethodContext, ObjectToLower, RESTGetAPIChannelMessageReactionUsersQuery, RESTPatchAPIChannelJSONBody, RESTPatchAPIGuildChannelPositionsJSONBody, RESTPostAPIChannelWebhookJSONBody, RESTPostAPIGuildChannelJSONBody, SortOrderType, StringToNumber, ToClass } from '../common';
4
4
  import type { GuildMember } from './GuildMember';
5
5
  import type { GuildRole } from './GuildRole';
6
- import { Webhook } from './Webhook';
7
6
  import { DiscordBase } from './extra/DiscordBase';
8
7
  export declare class BaseChannel<T extends ChannelType> extends DiscordBase<APIChannelBase<ChannelType>> {
9
8
  type: T;
10
- constructor(client: BaseClient, data: APIChannelBase<ChannelType>);
9
+ constructor(client: UsingClient, data: APIChannelBase<ChannelType>);
11
10
  static __intent__(id: '@me'): 'DirectMessages';
12
11
  static __intent__(id: string): 'DirectMessages' | 'Guilds';
13
12
  /** The URL to the channel */
@@ -58,7 +57,7 @@ interface IChannelTypes {
58
57
  export interface BaseGuildChannel extends ObjectToLower<Omit<APIGuildChannel<ChannelType>, 'permission_overwrites'>> {
59
58
  }
60
59
  export declare class BaseGuildChannel extends BaseChannel<ChannelType> {
61
- constructor(client: BaseClient, data: APIGuildChannel<ChannelType>);
60
+ constructor(client: UsingClient, data: APIGuildChannel<ChannelType>);
62
61
  permissionOverwrites: {
63
62
  fetch: () => import("..").ReturnCache<{
64
63
  type: number;
@@ -104,12 +103,12 @@ export declare class BaseGuildChannel extends BaseChannel<ChannelType> {
104
103
  export interface MessagesMethods extends BaseChannel<ChannelType> {
105
104
  }
106
105
  export declare class MessagesMethods extends DiscordBase {
107
- typing(): Promise<never>;
106
+ typing(): Promise<void>;
108
107
  messages: {
109
108
  write: (body: MessageCreateBodyRequest) => Promise<import("./Message").Message>;
110
109
  edit: (messageId: string, body: MessageUpdateBodyRequest) => Promise<import("./Message").Message>;
111
110
  crosspost: (messageId: string, reason?: string) => Promise<import("./Message").Message>;
112
- delete: (messageId: string, reason?: string) => Promise<void>;
111
+ delete: (messageId: string, reason?: string) => Promise<void | undefined>;
113
112
  fetch: (messageId: string) => Promise<import("./Message").Message>;
114
113
  purge: (messages: string[], reason?: string) => Promise<never>;
115
114
  };
@@ -119,10 +118,10 @@ export declare class MessagesMethods extends DiscordBase {
119
118
  delete: (messageId: string, reason?: string) => Promise<never>;
120
119
  };
121
120
  reactions: {
122
- add: (messageId: string, emoji: EmojiResolvable) => Promise<never>;
123
- delete: (messageId: string, emoji: EmojiResolvable, userId?: string) => Promise<never>;
121
+ add: (messageId: string, emoji: EmojiResolvable) => Promise<void>;
122
+ delete: (messageId: string, emoji: EmojiResolvable, userId?: string) => Promise<void>;
124
123
  fetch: (messageId: string, emoji: EmojiResolvable, query?: RESTGetAPIChannelMessageReactionUsersQuery) => Promise<import("./User").User[]>;
125
- purge: (messageId: string, emoji?: EmojiResolvable) => Promise<never>;
124
+ purge: (messageId: string, emoji?: EmojiResolvable) => Promise<void>;
126
125
  };
127
126
  static messages(ctx: MethodContext<{
128
127
  channelId: string;
@@ -130,17 +129,17 @@ export declare class MessagesMethods extends DiscordBase {
130
129
  write: (body: MessageCreateBodyRequest) => Promise<import("./Message").Message>;
131
130
  edit: (messageId: string, body: MessageUpdateBodyRequest) => Promise<import("./Message").Message>;
132
131
  crosspost: (messageId: string, reason?: string) => Promise<import("./Message").Message>;
133
- delete: (messageId: string, reason?: string) => Promise<void>;
132
+ delete: (messageId: string, reason?: string) => Promise<void | undefined>;
134
133
  fetch: (messageId: string) => Promise<import("./Message").Message>;
135
134
  purge: (messages: string[], reason?: string) => Promise<never>;
136
135
  };
137
136
  static reactions(ctx: MethodContext<{
138
137
  channelId: string;
139
138
  }>): {
140
- add: (messageId: string, emoji: EmojiResolvable) => Promise<never>;
141
- delete: (messageId: string, emoji: EmojiResolvable, userId?: string) => Promise<never>;
139
+ add: (messageId: string, emoji: EmojiResolvable) => Promise<void>;
140
+ delete: (messageId: string, emoji: EmojiResolvable, userId?: string) => Promise<void>;
142
141
  fetch: (messageId: string, emoji: EmojiResolvable, query?: RESTGetAPIChannelMessageReactionUsersQuery) => Promise<import("./User").User[]>;
143
- purge: (messageId: string, emoji?: EmojiResolvable) => Promise<never>;
142
+ purge: (messageId: string, emoji?: EmojiResolvable) => Promise<void>;
144
143
  };
145
144
  static pins(ctx: MethodContext<{
146
145
  channelId: string;
@@ -155,7 +154,7 @@ export interface TextBaseGuildChannel extends ObjectToLower<Omit<APITextChannel,
155
154
  }
156
155
  export declare class TextBaseGuildChannel extends BaseGuildChannel {
157
156
  }
158
- export default function channelFrom(data: APIChannelBase<ChannelType>, client: BaseClient): AllChannels;
157
+ export default function channelFrom(data: APIChannelBase<ChannelType>, client: UsingClient): AllChannels;
159
158
  export interface TopicableGuildChannel extends BaseChannel<ChannelType> {
160
159
  }
161
160
  export declare class TopicableGuildChannel extends DiscordBase {
@@ -180,24 +179,24 @@ export declare class VoiceChannelMethods extends DiscordBase {
180
179
  }
181
180
  export declare class WebhookGuildMethods extends DiscordBase {
182
181
  webhooks: {
183
- list: () => Promise<Webhook[]>;
182
+ list: () => Promise<import("./Webhook").Webhook[]>;
184
183
  };
185
184
  static guild(ctx: MethodContext<{
186
185
  guildId: string;
187
186
  }>): {
188
- list: () => Promise<Webhook[]>;
187
+ list: () => Promise<import("./Webhook").Webhook[]>;
189
188
  };
190
189
  }
191
190
  export declare class WebhookChannelMethods extends DiscordBase {
192
191
  webhooks: {
193
- list: () => Promise<Webhook[]>;
194
- create: (body: RESTPostAPIChannelWebhookJSONBody) => Promise<Webhook>;
192
+ list: () => Promise<import("./Webhook").Webhook[]>;
193
+ create: (body: RESTPostAPIChannelWebhookJSONBody) => Promise<import("./Webhook").Webhook>;
195
194
  };
196
195
  static channel(ctx: MethodContext<{
197
196
  channelId: string;
198
197
  }>): {
199
- list: () => Promise<Webhook[]>;
200
- create: (body: RESTPostAPIChannelWebhookJSONBody) => Promise<Webhook>;
198
+ list: () => Promise<import("./Webhook").Webhook[]>;
199
+ create: (body: RESTPostAPIChannelWebhookJSONBody) => Promise<import("./Webhook").Webhook>;
201
200
  };
202
201
  }
203
202
  export interface TextGuildChannel extends ObjectToLower<Omit<APITextChannel, 'type' | 'permission_overwrites'>>, BaseGuildChannel, TextBaseGuildChannel, WebhookChannelMethods {
@@ -238,8 +237,8 @@ export interface ThreadChannel extends ObjectToLower<Omit<APIThreadChannel, 'per
238
237
  export declare class ThreadChannel extends BaseChannel<ChannelType.PublicThread | ChannelType.AnnouncementThread | ChannelType.PrivateThread> {
239
238
  type: ChannelType.PublicThread | ChannelType.AnnouncementThread | ChannelType.PrivateThread;
240
239
  webhooks: {
241
- list: () => Promise<Webhook[]>;
242
- create: (body: RESTPostAPIChannelWebhookJSONBody) => Promise<Webhook>;
240
+ list: () => Promise<import("./Webhook").Webhook[]>;
241
+ create: (body: RESTPostAPIChannelWebhookJSONBody) => Promise<import("./Webhook").Webhook>;
243
242
  };
244
243
  setRatelimitPerUser(rate_limit_per_user: number | null | undefined): Promise<AllChannels>;
245
244
  pin(reason?: string): Promise<AllChannels>;