Personal Telegram developer console for GitHub
debug: add temporary Telegram diagnostics command
davoodmehraban89 committed
Oct 2, 2026 at 18:48 UTC
eeef0b8498fedb0fe9b0ee8a7120084319a36647
1 file changed
+7
src/index.js
+7
@@ -78,6 +78,13 @@ async function handleCommand(env, message) {
78
const chatId = message.chat?.id;
79
const command = (message.text || "").trim().split(/\s+/)[0].split("@")[0].toLowerCase();
80
81
+ if (command === "/diag") {
82
+ const senderId = message.from?.id;
83
+ const authState = isOwner(env, message.from) ? "authorized" : "unauthorized";
84
+ await sendMessage(env, chatId, `Telegram ID: <code>${senderId}</code>\nAuthorization: <b>${authState}</b>`);
85
+ return;
86
+ }
87
+
88
// Personal bot: fail silently for every Telegram user except the owner.
89
if (!isOwner(env, message.from)) return;
90