We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8dd00d0 commit 214032eCopy full SHA for 214032e
1 file changed
examples/discord-bot/src/handlers.ts
@@ -24,13 +24,16 @@ export function registerHandlers(
24
typeof raw?.channel_id === "string"
25
? raw.channel_id
26
: (event.channel?.id ?? "unknown");
27
+ const state = (await event.channel.state) as ThreadState | null;
28
+ const currentMode: Mode = state?.mode ?? DEFAULT_MODE;
29
+
30
const stub = await getAgentStub(env, channelId);
31
const responseText = await stub.ask(
32
event.text,
33
channelId,
34
event.user.userId,
35
event.user.fullName,
- DEFAULT_MODE
36
+ currentMode
37
);
38
39
await event.channel.post(
0 commit comments