Skip to content

Commit 2445f8b

Browse files
committed
fix: use ready client type for ctx
1 parent 16cd04f commit 2445f8b

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

  • apps/test-bot/src/app/commands/(interactions)
  • packages/commandkit/src/app/commands

apps/test-bot/src/app/commands/(interactions)/prompt.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
StringSelectMenu,
1111
StringSelectMenuOption,
1212
FileUpload,
13+
UserSelectMenu,
1314
} from 'commandkit';
1415
import { MessageFlags } from 'discord.js';
1516

@@ -68,6 +69,14 @@ export async function chatInput(ctx: ChatInputCommandContext) {
6869
/>
6970
</StringSelectMenu>
7071
</Label>
72+
<Label label="Member" description="The target of the command">
73+
<UserSelectMenu
74+
customId="member"
75+
minValues={1}
76+
maxValues={1}
77+
defaultValues={[ctx.interaction.user.id]}
78+
/>
79+
</Label>
7180
</Modal>
7281
);
7382

packages/commandkit/src/app/commands/Context.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ export class Context<
234234
/**
235235
* The client instance.
236236
*/
237-
public readonly client: Client;
237+
public readonly client: Client<true>;
238238

239239
/**
240240
* The command that this context belongs to.
@@ -265,7 +265,7 @@ export class Context<
265265
// these are assigned to readonly properties to make them accessible via object destructuring
266266
this.interaction = config.interaction;
267267
this.message = config.message;
268-
this.client = commandkit.client;
268+
this.client = commandkit.client as Client<true>;
269269
this.#store = config.environment?.store ?? config.store ?? new Collection();
270270
this.command = config.command;
271271

0 commit comments

Comments
 (0)