From 78a520efad95879b90d23ea87df818a443e217b5 Mon Sep 17 00:00:00 2001 From: Astra Date: Wed, 4 Feb 2026 16:05:30 +0000 Subject: [PATCH] Remove extra < --- main.go | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index 725894b..bc48a61 100644 --- a/main.go +++ b/main.go @@ -11,10 +11,10 @@ import ( ) const ( - AdminJoinRequestMsg = "New join #request from %s< [%d]\n\nJoin reason: %s" - AdminApprovedMsg = "✅ Join #request approved for %s< [%d]\n\nJoin reason: %s\nApproved by: %s\nApproved at: %s" - AdminDeclinedMsg = "❌ Join #request declined for %s< [%d]\n\nJoin reason: %s\nDeclined by: %s\nDeclined at: %s\nDeclined reason: %s" - AdminFailedMsg = "⚠️ Join #request failed for %s< [%d]\n\nJoin reason: %s\nFailure reason: %s" + AdminJoinRequestMsg = "New join #request from %s [%d]\n\nJoin reason: %s" + AdminApprovedMsg = "✅ Join #request approved for %s [%d]\n\nJoin reason: %s\nApproved by: %s\nApproved at: %s" + AdminDeclinedMsg = "❌ Join #request declined for %s [%d]\n\nJoin reason: %s\nDeclined by: %s\nDeclined at: %s\nDeclined reason: %s" + AdminFailedMsg = "⚠️ Join #request failed for %s [%d]\n\nJoin reason: %s\nFailure reason: %s" ) type ExtendedChatJoinRequest struct { @@ -53,6 +53,7 @@ func main() { for update := range updatesChannel { if update.ChatJoinRequest != nil { + log.Printf("%+v - %+v - %+v\n", update.ChatJoinRequest.Chat.ID, b.Config.TargetChatId, update.ChatJoinRequest.From) if update.ChatJoinRequest.Chat.ID == b.Config.TargetChatId { b.handleJoinRequest(update.ChatJoinRequest) } @@ -148,7 +149,12 @@ func (bot *Bot) handleJoinRequest(request *api.ChatJoinRequest) { if bot.Config.AdminChatTopicId != 0 { m.MessageThreadID = bot.Config.AdminChatTopicId } - r, _ := bot.API.Send(m) + log.Printf("%+v\n", m) + r, err := bot.API.Send(m) + if err != nil { + log.Printf("Failed to send join request to admin chat: %v", err) + return + } bot.WaitingForApproval[request.From.ID].JoinRequestMessageID = r.MessageID }