From 85f77f963d0309315c9548422ecbaa08fa5dd705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Free=20=E5=85=AC=E5=9C=92?= <45021001+FreeAoi@users.noreply.github.com> Date: Mon, 23 Dec 2024 12:04:22 -0600 Subject: [PATCH] change cache to flow as default in types (#309) * change cache to flow as default in types * chore: apply formatting * flow * chore: apply formatting --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: MARCROCK22 <57925328+MARCROCK22@users.noreply.github.com> --- src/commands/applications/chatcontext.ts | 6 +++--- src/commands/applications/entrycontext.ts | 6 +++--- src/commands/applications/menucontext.ts | 6 +++--- src/components/componentcontext.ts | 6 +++--- src/components/modalcontext.ts | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/commands/applications/chatcontext.ts b/src/commands/applications/chatcontext.ts index 63a969c..95832b3 100644 --- a/src/commands/applications/chatcontext.ts +++ b/src/commands/applications/chatcontext.ts @@ -145,7 +145,7 @@ export class CommandContext< channel(mode?: 'rest' | 'flow'): Promise>; channel(mode?: 'cache'): ReturnCache>; - channel(mode: 'cache' | 'rest' | 'flow' = 'cache') { + channel(mode: 'cache' | 'rest' | 'flow' = 'flow') { if (this.interaction?.channel && mode === 'cache') return this.client.cache.adapter.isAsync ? Promise.resolve(this.interaction.channel) : this.interaction.channel; switch (mode) { @@ -161,7 +161,7 @@ export class CommandContext< me(mode?: 'rest' | 'flow'): Promise; me(mode?: 'cache'): ReturnCache; - me(mode: 'cache' | 'rest' | 'flow' = 'cache') { + me(mode: 'cache' | 'rest' | 'flow' = 'flow') { if (!this.guildId) return mode === 'cache' ? (this.client.cache.adapter.isAsync ? Promise.resolve() : undefined) : Promise.resolve(); switch (mode) { @@ -177,7 +177,7 @@ export class CommandContext< guild(mode?: 'rest' | 'flow'): Promise | undefined>; guild(mode?: 'cache'): ReturnCache | undefined>; - guild(mode: 'cache' | 'rest' | 'flow' = 'cache') { + guild(mode: 'cache' | 'rest' | 'flow' = 'flow') { if (!this.guildId) return (mode === 'cache' ? this.client.cache.adapter.isAsync diff --git a/src/commands/applications/entrycontext.ts b/src/commands/applications/entrycontext.ts index 102e73c..38ff610 100644 --- a/src/commands/applications/entrycontext.ts +++ b/src/commands/applications/entrycontext.ts @@ -83,7 +83,7 @@ export class EntryPointContext ex channel(mode?: 'rest' | 'flow'): Promise; channel(mode?: 'cache'): ReturnCache; - channel(mode: 'cache' | 'rest' | 'flow' = 'cache') { + channel(mode: 'cache' | 'rest' | 'flow' = 'flow') { if (this.interaction.channel && mode === 'cache') return this.client.cache.adapter.isAsync ? Promise.resolve(this.interaction.channel) : this.interaction.channel; return this.client.channels.fetch(this.channelId, mode === 'rest'); @@ -91,7 +91,7 @@ export class EntryPointContext ex me(mode?: 'rest' | 'flow'): Promise; me(mode?: 'cache'): ReturnCache; - me(mode: 'cache' | 'rest' | 'flow' = 'cache') { + me(mode: 'cache' | 'rest' | 'flow' = 'flow') { if (!this.guildId) return mode === 'cache' ? (this.client.cache.adapter.isAsync ? Promise.resolve() : undefined) : Promise.resolve(); switch (mode) { @@ -104,7 +104,7 @@ export class EntryPointContext ex guild(mode?: 'rest' | 'flow'): Promise | undefined>; guild(mode?: 'cache'): ReturnCache | undefined>; - guild(mode: 'cache' | 'rest' | 'flow' = 'cache') { + guild(mode: 'cache' | 'rest' | 'flow' = 'flow') { if (!this.guildId) return ( mode === 'cache' ? (this.client.cache.adapter.isAsync ? Promise.resolve() : undefined) : Promise.resolve() diff --git a/src/commands/applications/menucontext.ts b/src/commands/applications/menucontext.ts index 4a1c9dd..6ed1acb 100644 --- a/src/commands/applications/menucontext.ts +++ b/src/commands/applications/menucontext.ts @@ -107,7 +107,7 @@ export class MenuCommandContext< channel(mode?: 'rest' | 'flow'): Promise; channel(mode?: 'cache'): ReturnCache; - channel(mode: 'cache' | 'rest' | 'flow' = 'cache') { + channel(mode: 'cache' | 'rest' | 'flow' = 'flow') { if (this.interaction?.channel && mode === 'cache') return this.client.cache.adapter.isAsync ? Promise.resolve(this.interaction.channel) : this.interaction.channel; return this.client.channels.fetch(this.channelId, mode === 'rest'); @@ -115,7 +115,7 @@ export class MenuCommandContext< me(mode?: 'rest' | 'flow'): Promise; me(mode?: 'cache'): ReturnCache; - me(mode: 'cache' | 'rest' | 'flow' = 'cache') { + me(mode: 'cache' | 'rest' | 'flow' = 'flow') { if (!this.guildId) return mode === 'cache' ? (this.client.cache.adapter.isAsync ? Promise.resolve() : undefined) : Promise.resolve(); switch (mode) { @@ -128,7 +128,7 @@ export class MenuCommandContext< guild(mode?: 'rest' | 'flow'): Promise | undefined>; guild(mode?: 'cache'): ReturnCache | undefined>; - guild(mode: 'cache' | 'rest' | 'flow' = 'cache') { + guild(mode: 'cache' | 'rest' | 'flow' = 'flow') { if (!this.guildId) return ( mode === 'cache' ? (this.client.cache.adapter.isAsync ? Promise.resolve() : undefined) : Promise.resolve() diff --git a/src/components/componentcontext.ts b/src/components/componentcontext.ts index 76a40d1..45258b9 100644 --- a/src/components/componentcontext.ts +++ b/src/components/componentcontext.ts @@ -156,7 +156,7 @@ export class ComponentContext< */ channel(mode?: 'rest' | 'flow'): Promise; channel(mode?: 'cache'): ReturnCache; - channel(mode: 'cache' | 'rest' | 'flow' = 'cache') { + channel(mode: 'cache' | 'rest' | 'flow' = 'flow') { if (this.interaction?.channel && mode === 'cache') return this.client.cache.adapter.isAsync ? Promise.resolve(this.interaction.channel) : this.interaction.channel; return this.client.channels.fetch(this.channelId, mode === 'rest'); @@ -169,7 +169,7 @@ export class ComponentContext< */ me(mode?: 'rest' | 'flow'): Promise; me(mode?: 'cache'): ReturnCache; - me(mode: 'cache' | 'rest' | 'flow' = 'cache') { + me(mode: 'cache' | 'rest' | 'flow' = 'flow') { if (!this.guildId) return mode === 'cache' ? (this.client.cache.adapter.isAsync ? Promise.resolve() : undefined) : Promise.resolve(); switch (mode) { @@ -187,7 +187,7 @@ export class ComponentContext< */ guild(mode?: 'rest' | 'flow'): Promise | undefined>; guild(mode?: 'cache'): ReturnCache | undefined>; - guild(mode: 'cache' | 'rest' | 'flow' = 'cache') { + guild(mode: 'cache' | 'rest' | 'flow' = 'flow') { if (!this.guildId) return ( mode === 'cache' ? (this.client.cache.adapter.isAsync ? Promise.resolve() : undefined) : Promise.resolve() diff --git a/src/components/modalcontext.ts b/src/components/modalcontext.ts index a0d10d6..9945b78 100644 --- a/src/components/modalcontext.ts +++ b/src/components/modalcontext.ts @@ -126,7 +126,7 @@ export class ModalContext extends */ channel(mode?: 'rest' | 'flow'): Promise; channel(mode?: 'cache'): ReturnCache; - channel(mode: 'cache' | 'rest' | 'flow' = 'cache') { + channel(mode: 'cache' | 'rest' | 'flow' = 'flow') { if (this.interaction?.channel && mode === 'cache') return this.client.cache.adapter.isAsync ? Promise.resolve(this.interaction.channel) : this.interaction.channel; return this.client.channels.fetch(this.channelId, mode === 'rest'); @@ -139,7 +139,7 @@ export class ModalContext extends */ me(mode?: 'rest' | 'flow'): Promise; me(mode?: 'cache'): ReturnCache; - me(mode: 'cache' | 'rest' | 'flow' = 'cache') { + me(mode: 'cache' | 'rest' | 'flow' = 'flow') { if (!this.guildId) return mode === 'cache' ? (this.client.cache.adapter.isAsync ? Promise.resolve() : undefined) : Promise.resolve(); switch (mode) { @@ -157,7 +157,7 @@ export class ModalContext extends */ guild(mode?: 'rest' | 'flow'): Promise | undefined>; guild(mode?: 'cache'): ReturnCache | undefined>; - guild(mode: 'cache' | 'rest' | 'flow' = 'cache') { + guild(mode: 'cache' | 'rest' | 'flow' = 'flow') { if (!this.guildId) return ( mode === 'cache' ? (this.client.cache.adapter.isAsync ? Promise.resolve() : undefined) : Promise.resolve()