Skip to content

Commit 08e451d

Browse files
committed
fix: restore Discord/Lark settings command and bump version to 0.0.87
1 parent 161bc37 commit 08e451d

File tree

3 files changed

+40
-8
lines changed

3 files changed

+40
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ode",
3-
"version": "0.0.86",
3+
"version": "0.0.87",
44
"description": "Coding anywhere with your coding agents connected",
55
"module": "packages/core/index.ts",
66
"type": "module",

packages/ims/discord/client.ts

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ const DISCORD_LAUNCHER_COMMANDS = [
5757
name: "setting",
5858
description: "Open Ode settings",
5959
},
60+
{
61+
name: "settings",
62+
description: "Open Ode settings",
63+
},
6064
] as const;
6165

6266
const discordClients = new Map<string, Client>();
@@ -273,7 +277,7 @@ async function renameDiscordThread(
273277

274278
function parseLauncherCommand(text: string): "setting" | null {
275279
const trimmed = text.trim().toLowerCase();
276-
if (/^\/setting\b/.test(trimmed)) return "setting";
280+
if (/^\/?settings?\b/.test(trimmed)) return "setting";
277281
return null;
278282
}
279283

@@ -319,6 +323,19 @@ function buildLauncherReplyPayload(params: {
319323
};
320324
}
321325

326+
async function sendLauncherReplyForMessage(params: {
327+
message: any;
328+
command: LauncherCommand;
329+
channelId: string;
330+
}): Promise<void> {
331+
const payload = buildLauncherReplyPayload({
332+
command: params.command,
333+
userId: params.message.author.id,
334+
channelId: params.channelId,
335+
});
336+
await params.message.reply(payload);
337+
}
338+
322339
function getModalValue(interaction: any, fieldId: string): string {
323340
return interaction.fields.getTextInputValue(fieldId) || "";
324341
}
@@ -913,7 +930,12 @@ export async function startDiscordRuntime(reason: string): Promise<boolean> {
913930
const text = message.content.trim();
914931
const launcherCommand = parseLauncherCommand(text);
915932
if (launcherCommand) {
916-
log.debug("Ignoring Discord message command in thread; slash command handles it", {
933+
await sendLauncherReplyForMessage({
934+
message,
935+
command: launcherCommand,
936+
channelId: parentId,
937+
});
938+
log.debug("Handled Discord message settings command in thread", {
917939
command: launcherCommand,
918940
threadId,
919941
});
@@ -948,7 +970,12 @@ export async function startDiscordRuntime(reason: string): Promise<boolean> {
948970

949971
const parentLauncherCommand = parseLauncherCommand(message.content);
950972
if (parentLauncherCommand) {
951-
log.debug("Ignoring Discord message command in parent channel; slash command handles it", {
973+
await sendLauncherReplyForMessage({
974+
message,
975+
command: parentLauncherCommand,
976+
channelId: parentId,
977+
});
978+
log.debug("Handled Discord message settings command in parent channel", {
952979
command: parentLauncherCommand,
953980
channelId: parentId,
954981
});
@@ -961,7 +988,12 @@ export async function startDiscordRuntime(reason: string): Promise<boolean> {
961988
const cleaned = cleanBotMention(message.content, client.user.id);
962989
const cleanedLauncherCommand = parseLauncherCommand(cleaned);
963990
if (cleanedLauncherCommand) {
964-
log.debug("Ignoring Discord mention command; slash command handles it", {
991+
await sendLauncherReplyForMessage({
992+
message,
993+
command: cleanedLauncherCommand,
994+
channelId: parentId,
995+
});
996+
log.debug("Handled Discord mention settings command", {
965997
command: cleanedLauncherCommand,
966998
channelId: parentId,
967999
});
@@ -1011,10 +1043,10 @@ export async function startDiscordRuntime(reason: string): Promise<boolean> {
10111043

10121044
if (!interaction.isChatInputCommand || !interaction.isChatInputCommand()) return;
10131045
const commandName = String(interaction.commandName || "").toLowerCase();
1014-
if (commandName !== "setting") return;
1046+
if (commandName !== "setting" && commandName !== "settings") return;
10151047

10161048
const payload = buildLauncherReplyPayload({
1017-
command: commandName as LauncherCommand,
1049+
command: "setting",
10181050
userId: interaction.user.id,
10191051
channelId: getResolvedChannelId(interaction),
10201052
});

packages/ims/lark/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ function parseLarkText(content: string | undefined): string {
216216

217217
function isSettingsCommand(text: string): boolean {
218218
const normalized = text.trim().replace(/^/, "/");
219-
return /^\/?setting(?:\s|$)/i.test(normalized);
219+
return /^\/?settings?(?:\s|$)/i.test(normalized);
220220
}
221221

222222
function getLocalSettingsUrl(): string {

0 commit comments

Comments
 (0)