Skip to content

Commit 8dea59e

Browse files
fitz123claude
andcommitted
fix: address code review findings
- Revert unrelated DM typing suppression in telegram-adapter.ts (out of scope) - Fix TypeScript errors in test mocks (missing UserFromGetMe and PrivateChat properties) - Clarify test assertion comment for /clean handler wiring Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent bbd8f39 commit 8dea59e

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

bot/src/__tests__/telegram-bot.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,7 +1301,7 @@ describe("command handler wiring", () => {
13011301
message: {
13021302
message_id: updateId,
13031303
from: { id: testChatId, is_bot: false, first_name: "Test" },
1304-
chat: { id: testChatId, type: "private" as const },
1304+
chat: { id: testChatId, type: "private" as const, first_name: "Test" },
13051305
date: Math.floor(Date.now() / 1000),
13061306
text,
13071307
entities: [{ offset: 0, length: text.length, type: "bot_command" as const }],
@@ -1324,6 +1324,8 @@ describe("command handler wiring", () => {
13241324
supports_inline_queries: false,
13251325
can_connect_to_business: false,
13261326
has_main_web_app: false,
1327+
has_topics_enabled: false,
1328+
allows_users_to_create_topics: false,
13271329
};
13281330
return bot;
13291331
}
@@ -1343,6 +1345,6 @@ describe("command handler wiring", () => {
13431345

13441346
await bot.handleUpdate(makeCommandUpdate("clean", 2));
13451347
assert.ok(mockSM.calls.includes("destroySession"), "/clean should call destroySession");
1346-
assert.ok(!mockSM.calls.includes("closeSession"), "/clean should NOT call closeSession directly");
1348+
assert.ok(!mockSM.calls.includes("closeSession"), "/clean handler calls destroySession, not closeSession directly");
13471349
});
13481350
});

bot/src/telegram-adapter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export function createTelegramAdapter(
7676
},
7777

7878
async sendTyping(): Promise<void> {
79-
if (!chatId || isDm) return;
79+
if (!chatId) return;
8080
await ctx.api.sendChatAction(
8181
chatId,
8282
"typing",

0 commit comments

Comments
 (0)