mirror of
https://github.com/tiennm99/claude-status-webhook.git
synced 2026-04-17 15:20:37 +00:00
fix: rename KV binding to CLAUDE_STATUS and fix threadId nullish check
- Rename KV binding SUBSCRIBERS → CLAUDE_STATUS for consistent naming - Fix || null → ?? null to preserve threadId 0 (General topic) - Update KV namespace creation command in README
This commit is contained in:
@@ -18,7 +18,7 @@ import {
|
||||
function getChatTarget(ctx) {
|
||||
return {
|
||||
chatId: ctx.chat.id,
|
||||
threadId: ctx.message?.message_thread_id || null,
|
||||
threadId: ctx.message?.message_thread_id ?? null,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ function getChatTarget(ctx) {
|
||||
*/
|
||||
export async function handleTelegramWebhook(c) {
|
||||
const bot = new Bot(c.env.BOT_TOKEN);
|
||||
const kv = c.env.SUBSCRIBERS;
|
||||
const kv = c.env.CLAUDE_STATUS;
|
||||
|
||||
bot.command("start", async (ctx) => {
|
||||
const { chatId, threadId } = getChatTarget(ctx);
|
||||
|
||||
Reference in New Issue
Block a user