Fix(chat-id): Handling unregistered chat ID
All checks were successful
Webhook-Everything/Webhook-Everything/pipeline/head This commit looks good

This commit is contained in:
2025-12-01 02:24:59 +08:00
parent 0c3df1a5f0
commit c9ba5c4312
7 changed files with 44 additions and 198 deletions

View File

@@ -104,6 +104,15 @@ func (env *Env) TelegramListenAndGen() error {
fmt.Println(err)
}
if chatIDMap.ChatIDShort == "" {
msg := tgbotapi.NewMessage(update.Message.Chat.ID, "Please send /register to register for a chat ID")
_, err := bot.Send(msg)
if err != nil {
log.Println(err)
}
continue
}
var handled = false
for _, currFunc := range env.HandlerFunctions {
currHandled, responseText := currFunc(chatIDMap.ChatIDShort, update.Message.Text)