diff --git a/scripts/setup-bot.js b/scripts/setup-bot.js
index 27db724..4e1faa8 100644
--- a/scripts/setup-bot.js
+++ b/scripts/setup-bot.js
@@ -11,6 +11,7 @@ const BOT_COMMANDS = [
{ command: "status", description: "Current system status" },
{ command: "subscribe", description: "Set notification preferences" },
{ command: "history", description: "Recent incidents" },
+ { command: "info", description: "Chat ID & subscription info" },
{ command: "uptime", description: "Component health overview" },
];
diff --git a/src/bot-commands.js b/src/bot-commands.js
index 1f8693c..6cd8d0b 100644
--- a/src/bot-commands.js
+++ b/src/bot-commands.js
@@ -132,6 +132,27 @@ function createBot(token) {
});
});
+ bot.command("info", async (ctx) => {
+ const { chatId, threadId } = getChatTarget(ctx);
+ const idLine =
+ threadId != null ? `${chatId}:${threadId}` : `${chatId}`;
+
+ const sub = await getSubscriber(kv, chatId, threadId);
+ let subLine;
+ if (!sub) {
+ subLine = "Not subscribed. Use /start to subscribe.";
+ } else {
+ const types = sub.types?.join(", ") || "none";
+ const components = sub.components?.length ? sub.components.join(", ") : "all";
+ subLine =
+ `Types: ${types}\n` + `Components: ${components}`;
+ }
+
+ await ctx.reply(`Chat Info\n\nChat ID: ${idLine}\n\n${subLine}`, {
+ parse_mode: "HTML",
+ });
+ });
+
// Info commands: /help, /status, /history, /uptime
registerInfoCommands(bot);
@@ -141,6 +162,7 @@ function createBot(token) {
"/help — Detailed command guide\n" +
"/start — Subscribe to notifications\n" +
"/stop — Unsubscribe\n" +
+ "/info — Chat ID & subscription info\n" +
"/status — Current system status\n" +
"/subscribe — Notification preferences\n" +
"/history — Recent incidents\n" +
diff --git a/src/bot-info-commands.js b/src/bot-info-commands.js
index 6d3d79e..dbc7437 100644
--- a/src/bot-info-commands.js
+++ b/src/bot-info-commands.js
@@ -26,6 +26,8 @@ export function registerInfoCommands(bot) {
`Show current status of all components.\n` +
`Add a component name for a specific check.\n` +
`Example: /status api\n\n` +
+ `/info\n` +
+ `Show chat ID and current subscription status.\n\n` +
`/subscribe <type> [component]\n` +
`Set what notifications you receive.\n` +
`Types: incident, component, all\n` +