seyfert 2.2.1-dev-12627012581.0 → 2.2.1-dev-12681581510.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.
@@ -1,4 +1,4 @@
1
- import { type AllChannels, Embed } from '..';
1
+ import { type AllChannels, Embed, ReturnCache } from '..';
2
2
  import type { ListenerOptions } from '../builders';
3
3
  import { type GuildMemberStructure, type GuildStructure, type MessageStructure, type PollStructure, type UserStructure, type WebhookMessageStructure, type WebhookStructure } from '../client/transformers';
4
4
  import type { UsingClient } from '../commands';
@@ -30,7 +30,8 @@ export declare class BaseMessage extends DiscordBase {
30
30
  get user(): UserStructure;
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<GuildStructure<'api'> | undefined>;
33
+ guild(mode?: 'rest' | 'flow'): Promise<GuildStructure<'cached' | 'api'> | undefined>;
34
+ guild(mode: 'cache'): ReturnCache<GuildStructure<'cached'> | undefined>;
34
35
  channel(force?: boolean): Promise<AllChannels>;
35
36
  react(emoji: EmojiResolvable): Promise<void>;
36
37
  private patch;
@@ -29,10 +29,15 @@ class BaseMessage extends DiscordBase_1.DiscordBase {
29
29
  get url() {
30
30
  return common_2.Formatter.messageLink(this.guildId ?? '@me', this.channelId, this.id);
31
31
  }
32
- async guild(force = false) {
32
+ guild(mode = 'flow') {
33
33
  if (!this.guildId)
34
- return;
35
- return this.client.guilds.fetch(this.guildId, force);
34
+ return (mode === 'cache' ? (this.client.cache.adapter.isAsync ? Promise.resolve() : undefined) : Promise.resolve());
35
+ switch (mode) {
36
+ case 'cache':
37
+ return this.client.cache.guilds?.get(this.guildId);
38
+ default:
39
+ return this.client.guilds.fetch(this.guildId, mode === 'rest');
40
+ }
36
41
  }
37
42
  channel(force = false) {
38
43
  return this.client.channels.fetch(this.channelId, force);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seyfert",
3
- "version": "2.2.1-dev-12627012581.0",
3
+ "version": "2.2.1-dev-12681581510.0",
4
4
  "description": "The most advanced framework for discord bots",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",