seyfert 2.1.1-dev-11945595837.0 → 2.1.1-dev-11991540762.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.
@@ -439,6 +439,7 @@ class CommandHandler extends common_1.BaseHandler {
439
439
  return command;
440
440
  }
441
441
  parseSubCommandLocales(command) {
442
+ this.parseGlobalLocales(command);
442
443
  for (const i of command.options ?? []) {
443
444
  this.parseCommandOptionLocales(i);
444
445
  }
@@ -9,7 +9,7 @@ class ApplicationShorter extends base_1.BaseShorter {
9
9
  * @param applicationId The ID of the application.
10
10
  * @returns The emojis.
11
11
  */
12
- async listEmojis(applicationId) {
12
+ listEmojis(applicationId) {
13
13
  return this.client.proxy.applications(applicationId).emojis.get();
14
14
  }
15
15
  /**
@@ -18,7 +18,7 @@ class ApplicationShorter extends base_1.BaseShorter {
18
18
  * @param emojiId The ID of the emoji.
19
19
  * @returns The emoji.
20
20
  */
21
- async getEmoji(applicationId, emojiId) {
21
+ getEmoji(applicationId, emojiId) {
22
22
  return this.client.proxy.applications(applicationId).emojis(emojiId).get();
23
23
  }
24
24
  /**
@@ -28,7 +28,7 @@ class ApplicationShorter extends base_1.BaseShorter {
28
28
  * @param body.image The [image data string](https://discord.com/developers/docs/reference#image-data) of the emoji.
29
29
  * @returns The created emoji.
30
30
  */
31
- async createEmoji(applicationId, body) {
31
+ createEmoji(applicationId, body) {
32
32
  return this.client.proxy.applications(applicationId).emojis.post({ body });
33
33
  }
34
34
  /**
@@ -36,7 +36,7 @@ class ApplicationShorter extends base_1.BaseShorter {
36
36
  * @param applicationId The ID of the application.
37
37
  * @param [query] The query parameters.
38
38
  */
39
- async listEntitlements(applicationId, query) {
39
+ listEntitlements(applicationId, query) {
40
40
  return this.client.proxy
41
41
  .applications(applicationId)
42
42
  .entitlements.get({ query })
@@ -47,7 +47,7 @@ class ApplicationShorter extends base_1.BaseShorter {
47
47
  * @param applicationId The ID of the application.
48
48
  * @param entitlementId The ID of the entitlement.
49
49
  */
50
- async consumeEntitlement(applicationId, entitlementId) {
50
+ consumeEntitlement(applicationId, entitlementId) {
51
51
  return this.client.proxy.applications(applicationId).entitlements(entitlementId).consume.post();
52
52
  }
53
53
  /**
@@ -55,7 +55,7 @@ class ApplicationShorter extends base_1.BaseShorter {
55
55
  * @param applicationId The ID of the application.
56
56
  * @param body The body of the request.
57
57
  */
58
- async createTestEntitlement(applicationId, body) {
58
+ createTestEntitlement(applicationId, body) {
59
59
  return this.client.proxy
60
60
  .applications(applicationId)
61
61
  .entitlements.post({ body })
@@ -66,7 +66,7 @@ class ApplicationShorter extends base_1.BaseShorter {
66
66
  * @param applicationId The ID of the application.
67
67
  * @param entitlementId The ID of the entitlement.
68
68
  */
69
- async deleteTestEntitlement(applicationId, entitlementId) {
69
+ deleteTestEntitlement(applicationId, entitlementId) {
70
70
  return this.client.proxy.applications(applicationId).entitlements(entitlementId).delete();
71
71
  }
72
72
  /**
@@ -74,7 +74,7 @@ class ApplicationShorter extends base_1.BaseShorter {
74
74
  * @param applicationId The ID of the application.
75
75
  * @returns The SKUs.
76
76
  */
77
- async listSKUs(applicationId) {
77
+ listSKUs(applicationId) {
78
78
  return this.client.proxy.applications(applicationId).skus.get();
79
79
  }
80
80
  }
@@ -14,7 +14,7 @@ export declare class BanShorter extends BaseShorter {
14
14
  * @param memberId The ID of the member to unban.
15
15
  * @param reason The reason for unbanning the member.
16
16
  */
17
- remove(guildId: string, memberId: string, reason?: string): Promise<void>;
17
+ remove(guildId: string, memberId: string, reason?: string): Promise<never>;
18
18
  /**
19
19
  * Bans a member from the guild.
20
20
  * @param guildId The ID of the guild.
@@ -22,8 +22,8 @@ class BanShorter extends base_1.BaseShorter {
22
22
  * @param memberId The ID of the member to unban.
23
23
  * @param reason The reason for unbanning the member.
24
24
  */
25
- async remove(guildId, memberId, reason) {
26
- await this.client.proxy.guilds(guildId).bans(memberId).delete({ reason });
25
+ remove(guildId, memberId, reason) {
26
+ return this.client.proxy.guilds(guildId).bans(memberId).delete({ reason });
27
27
  }
28
28
  /**
29
29
  * Bans a member from the guild.
@@ -64,8 +64,8 @@ class ChannelShorter extends base_1.BaseShorter {
64
64
  * @param id The ID of the channel.
65
65
  * @returns A Promise that resolves when the typing indicator is successfully sent.
66
66
  */
67
- async typing(id) {
68
- await this.client.proxy.channels(id).typing.post();
67
+ typing(id) {
68
+ return this.client.proxy.channels(id).typing.post();
69
69
  }
70
70
  async pins(channelId) {
71
71
  const messages = await this.client.proxy.channels(channelId).pins.get();
@@ -100,7 +100,7 @@ class ChannelShorter extends base_1.BaseShorter {
100
100
  * @param reason The reason for unpinning the message.
101
101
  * @returns A promise that resolves when the thread is succesfully created.
102
102
  */
103
- async thread(channelId, body, reason) {
103
+ thread(channelId, body, reason) {
104
104
  return this.client.threads.create(channelId, body, reason);
105
105
  }
106
106
  async memberPermissions(channelId, member, checkAdmin = true) {
@@ -24,7 +24,7 @@ export declare class MemberShorter extends BaseShorter {
24
24
  * @param memberId The ID of the member to unban.
25
25
  * @param reason The reason for unbanning the member.
26
26
  */
27
- unban(guildId: string, memberId: string, reason?: string): Promise<void>;
27
+ unban(guildId: string, memberId: string, reason?: string): Promise<never>;
28
28
  /**
29
29
  * Bans a member from the guild.
30
30
  * @param guildId The ID of the guild.
@@ -49,8 +49,8 @@ class MemberShorter extends base_1.BaseShorter {
49
49
  * @param memberId The ID of the member to unban.
50
50
  * @param reason The reason for unbanning the member.
51
51
  */
52
- async unban(guildId, memberId, reason) {
53
- await this.client.proxy.guilds(guildId).bans(memberId).delete({ reason });
52
+ unban(guildId, memberId, reason) {
53
+ return this.client.proxy.guilds(guildId).bans(memberId).delete({ reason });
54
54
  }
55
55
  /**
56
56
  * Bans a member from the guild.
@@ -10,7 +10,7 @@ class ThreadShorter extends base_1.BaseShorter {
10
10
  * @param reason The reason for unpinning the message.
11
11
  * @returns A promise that resolves when the thread is succesfully created.
12
12
  */
13
- async create(channelId, body, reason) {
13
+ create(channelId, body, reason) {
14
14
  return (this.client.proxy
15
15
  .channels(channelId)
16
16
  .threads.post({ body, reason })
@@ -20,7 +20,7 @@ class ThreadShorter extends base_1.BaseShorter {
20
20
  return (0, structures_1.channelFrom)(thread, this.client);
21
21
  }));
22
22
  }
23
- async fromMessage(channelId, messageId, options) {
23
+ fromMessage(channelId, messageId, options) {
24
24
  const { reason, ...body } = options;
25
25
  return this.client.proxy
26
26
  .channels(channelId)
@@ -44,7 +44,7 @@ export declare class Guild<State extends StructStates = 'api'> extends Guild_bas
44
44
  members: {
45
45
  resolve: (resolve: import("../common").GuildMemberResolvable) => Promise<GuildMember | undefined>;
46
46
  search: (query?: import("../types").RESTGetAPIGuildMembersSearchQuery) => Promise<GuildMember[]>;
47
- unban: (id: string, reason?: string) => Promise<void>;
47
+ unban: (id: string, reason?: string) => Promise<never>;
48
48
  ban: (id: string, body?: import("../types").RESTPutAPIGuildBanJSONBody, reason?: string) => Promise<void>;
49
49
  kick: (id: string, reason?: string) => Promise<void>;
50
50
  edit: (id: string, body: import("../types").RESTPatchAPIGuildMemberJSONBody, reason?: string) => Promise<GuildMember>;
@@ -86,7 +86,7 @@ export declare class Guild<State extends StructStates = 'api'> extends Guild_bas
86
86
  fetch: (userId: string, force?: boolean) => Promise<GuildBan>;
87
87
  list: (query?: import("../types").RESTGetAPIGuildBansQuery, force?: boolean) => Promise<GuildBan[]>;
88
88
  create: (memberId: string, body?: Parameters<import("../common/shorters/bans").BanShorter["create"]>[2], reason?: string) => Promise<void>;
89
- remove: (memberId: string, reason?: string) => Promise<void>;
89
+ remove: (memberId: string, reason?: string) => Promise<never>;
90
90
  bulkCreate: (body: Parameters<import("../common/shorters/bans").BanShorter["bulkCreate"]>[1], reason?: string) => Promise<import("../types").RESTPostAPIGuildBulkBanResult>;
91
91
  };
92
92
  edit(body: RESTPatchAPIGuildJSONBody, reason?: string): Promise<Guild<"api">>;
@@ -9,7 +9,7 @@ export declare class GuildBan extends DiscordBase {
9
9
  readonly guildId: string;
10
10
  constructor(client: UsingClient, data: APIBan, guildId: string);
11
11
  create(body?: Parameters<BanShorter['create']>[2], reason?: string): Promise<void>;
12
- remove(reason?: string): Promise<void>;
12
+ remove(reason?: string): Promise<never>;
13
13
  guild(force?: boolean): Promise<import("./Guild").Guild<"api">>;
14
14
  fetch(force?: boolean): Promise<GuildBan>;
15
15
  toString(): `<@${string}>`;
@@ -19,7 +19,7 @@ export declare class GuildBan extends DiscordBase {
19
19
  fetch: (userId: string, force?: boolean) => Promise<GuildBan>;
20
20
  list: (query?: RESTGetAPIGuildBansQuery, force?: boolean) => Promise<GuildBan[]>;
21
21
  create: (memberId: string, body?: Parameters<BanShorter["create"]>[2], reason?: string) => Promise<void>;
22
- remove: (memberId: string, reason?: string) => Promise<void>;
22
+ remove: (memberId: string, reason?: string) => Promise<never>;
23
23
  bulkCreate: (body: Parameters<BanShorter["bulkCreate"]>[1], reason?: string) => Promise<import("../types").RESTPostAPIGuildBulkBanResult>;
24
24
  };
25
25
  }
@@ -46,7 +46,7 @@ export declare class BaseGuildMember extends DiscordBase {
46
46
  }>): {
47
47
  resolve: (resolve: GuildMemberResolvable) => Promise<GuildMember | undefined>;
48
48
  search: (query?: RESTGetAPIGuildMembersSearchQuery) => Promise<GuildMember[]>;
49
- unban: (id: string, reason?: string) => Promise<void>;
49
+ unban: (id: string, reason?: string) => Promise<never>;
50
50
  ban: (id: string, body?: RESTPutAPIGuildBanJSONBody, reason?: string) => Promise<void>;
51
51
  kick: (id: string, reason?: string) => Promise<void>;
52
52
  edit: (id: string, body: RESTPatchAPIGuildMemberJSONBody, reason?: string) => Promise<GuildMember>;
@@ -30,7 +30,7 @@ export declare class BaseMessage extends DiscordBase {
30
30
  get user(): import("./User").User;
31
31
  createComponentCollector(options?: ListenerOptions): import("../components/handler").CreateComponentCollectorResult;
32
32
  get url(): `https://discord.com/channels/${string}/${string}/${string}`;
33
- guild(force?: boolean): Promise<import("./Guild").Guild<"api">> | undefined;
33
+ guild(force?: boolean): Promise<import("./Guild").Guild<"api"> | undefined>;
34
34
  channel(force?: boolean): Promise<import("./channels").AllChannels>;
35
35
  react(emoji: EmojiResolvable): Promise<void>;
36
36
  private patch;
@@ -29,12 +29,12 @@ class BaseMessage extends DiscordBase_1.DiscordBase {
29
29
  get url() {
30
30
  return common_2.Formatter.messageLink(this.guildId, this.channelId, this.id);
31
31
  }
32
- guild(force = false) {
32
+ async guild(force = false) {
33
33
  if (!this.guildId)
34
34
  return;
35
35
  return this.client.guilds.fetch(this.guildId, force);
36
36
  }
37
- async channel(force = false) {
37
+ channel(force = false) {
38
38
  return this.client.channels.fetch(this.channelId, force);
39
39
  }
40
40
  react(emoji) {
@@ -13,7 +13,7 @@ export declare class VoiceState extends Base {
13
13
  get isMuted(): boolean;
14
14
  member(force?: boolean): Promise<import("./GuildMember").GuildMember>;
15
15
  user(force?: boolean): Promise<import("./User").User>;
16
- channel(force?: boolean): Promise<AllGuildVoiceChannels> | undefined;
16
+ channel(force?: boolean): Promise<AllGuildVoiceChannels | undefined>;
17
17
  setMute(mute?: boolean, reason?: string): Promise<import("./GuildMember").GuildMember>;
18
18
  setDeaf(deaf?: boolean, reason?: string): Promise<import("./GuildMember").GuildMember>;
19
19
  setSuppress(suppress?: boolean): Promise<void>;
@@ -21,7 +21,7 @@ class VoiceState extends Base_1.Base {
21
21
  user(force) {
22
22
  return this.client.users.fetch(this.userId, force);
23
23
  }
24
- channel(force) {
24
+ async channel(force) {
25
25
  if (!this.channelId)
26
26
  return;
27
27
  return this.client.channels.fetch(this.channelId, force);
@@ -1,7 +1,7 @@
1
- import { Collection, type RawFile } from '..';
2
- import { type BaseChannelStructure, type BaseGuildChannelStructure, type CategoryChannelStructure, type DMChannelStructure, type DirectoryChannelStructure, type ForumChannelStructure, type MediaChannelStructure, type NewsChannelStructure, type StageChannelStructure, type TextGuildChannelStructure, type ThreadChannelStructure, type VoiceChannelStructure } from '../client';
1
+ import { Collection, type RawFile, type ReturnCache } from '..';
2
+ import { type BaseChannelStructure, type BaseGuildChannelStructure, type CategoryChannelStructure, type DMChannelStructure, type DirectoryChannelStructure, type ForumChannelStructure, type MediaChannelStructure, type NewsChannelStructure, type StageChannelStructure, type TextGuildChannelStructure, type ThreadChannelStructure, type VoiceChannelStructure, type VoiceStateStructure } from '../client';
3
3
  import type { UsingClient } from '../commands';
4
- import type { EmojiResolvable, MessageCreateBodyRequest, MessageUpdateBodyRequest, MethodContext, ObjectToLower, StringToNumber, ToClass } from '../common';
4
+ import { type EmojiResolvable, type MessageCreateBodyRequest, type MessageUpdateBodyRequest, type MethodContext, type ObjectToLower, type StringToNumber, type ToClass } from '../common';
5
5
  import { type APIChannelBase, type APIDMChannel, type APIGuildCategoryChannel, type APIGuildChannel, type APIGuildForumChannel, type APIGuildForumDefaultReactionEmoji, type APIGuildForumTag, type APIGuildMediaChannel, type APIGuildStageVoiceChannel, type APIGuildVoiceChannel, type APINewsChannel, type APITextChannel, type APIThreadChannel, ChannelType, type RESTGetAPIChannelMessageReactionUsersQuery, type RESTGetAPIChannelMessagesQuery, type RESTPatchAPIChannelJSONBody, type RESTPatchAPIGuildChannelPositionsJSONBody, type RESTPostAPIChannelWebhookJSONBody, type RESTPostAPIGuildChannelJSONBody, type RESTPostAPIGuildForumThreadsJSONBody, type SortOrderType, type ThreadAutoArchiveDuration, VideoQualityMode } from '../types';
6
6
  import type { GuildMember } from './GuildMember';
7
7
  import type { GuildRole } from './GuildRole';
@@ -63,7 +63,7 @@ export interface BaseGuildChannel extends ObjectToLower<Omit<APIGuildChannel<Cha
63
63
  export declare class BaseGuildChannel extends BaseChannel<ChannelType> {
64
64
  constructor(client: UsingClient, data: APIGuildChannel<ChannelType>);
65
65
  permissionOverwrites: {
66
- fetch: () => import("..").ReturnCache<{
66
+ fetch: () => ReturnCache<{
67
67
  type: number;
68
68
  id: string;
69
69
  deny: import("./extra/Permissions").PermissionsBitField;
@@ -190,7 +190,7 @@ export declare class VoiceChannelMethods extends DiscordBase {
190
190
  setRTC(rtc_region: string | null, reason?: string): Promise<AllChannels>;
191
191
  setVideoQuality(quality: keyof typeof VideoQualityMode, reason?: string): Promise<AllChannels>;
192
192
  setVoiceState(status?: string | null): Promise<never>;
193
- states(): Promise<import("./VoiceState").VoiceState[]>;
193
+ states(): ReturnCache<VoiceStateStructure[]>;
194
194
  members(force?: boolean): Promise<Collection<string, GuildMember>>;
195
195
  }
196
196
  export declare class WebhookGuildMethods extends DiscordBase {
@@ -11,6 +11,7 @@ exports.channelFrom = channelFrom;
11
11
  const __1 = require("..");
12
12
  const builders_1 = require("../builders");
13
13
  const client_1 = require("../client");
14
+ const common_1 = require("../common");
14
15
  const mixer_1 = require("../deps/mixer");
15
16
  const types_1 = require("../types");
16
17
  const DiscordBase_1 = require("./extra/DiscordBase");
@@ -257,7 +258,7 @@ let ThreadOnlyMethods = class ThreadOnlyMethods extends DiscordBase_1.DiscordBas
257
258
  setThreadRateLimit(rate, reason) {
258
259
  return this.edit({ default_thread_rate_limit_per_user: rate }, reason);
259
260
  }
260
- async thread(body, reason) {
261
+ thread(body, reason) {
261
262
  return this.client.channels.thread(this.id, body, reason);
262
263
  }
263
264
  };
@@ -282,13 +283,15 @@ class VoiceChannelMethods extends DiscordBase_1.DiscordBase {
282
283
  setVoiceState(status = null) {
283
284
  return this.client.channels.setVoiceStatus(this.id, status);
284
285
  }
285
- async states() {
286
+ states() {
286
287
  if (!this.guildId)
287
- return [];
288
- const states = await this.cache.voiceStates?.values(this.guildId);
289
- if (!states?.length)
290
- return [];
291
- return states.filter(state => state.channelId === this.id);
288
+ return this.cache.adapter.isAsync ? Promise.resolve([]) : [];
289
+ return (0, common_1.fakePromise)(this.cache.voiceStates?.values(this.guildId) ??
290
+ (this.cache.adapter.isAsync
291
+ ? Promise.resolve([])
292
+ : [])).then(states => {
293
+ return states.filter(state => state.channelId === this.id);
294
+ });
292
295
  }
293
296
  async members(force) {
294
297
  const collection = new __1.Collection();
@@ -321,7 +324,7 @@ class WebhookChannelMethods extends DiscordBase_1.DiscordBase {
321
324
  static channel(ctx) {
322
325
  return {
323
326
  list: () => ctx.client.webhooks.listFromChannel(ctx.channelId),
324
- create: async (body) => ctx.client.webhooks.create(ctx.channelId, body),
327
+ create: (body) => ctx.client.webhooks.create(ctx.channelId, body),
325
328
  };
326
329
  }
327
330
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seyfert",
3
- "version": "2.1.1-dev-11945595837.0",
3
+ "version": "2.1.1-dev-11991540762.0",
4
4
  "description": "The most advanced framework for discord bots",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",