Remove extra <

This commit is contained in:
Astra 2026-02-04 16:05:30 +00:00
parent 71079d3444
commit 78a520efad

16
main.go
View file

@ -11,10 +11,10 @@ import (
)
const (
AdminJoinRequestMsg = "New join #request from %s< [<code>%d</code>]\n\n<b>Join reason</b>: %s"
AdminApprovedMsg = "✅ Join #request approved for %s< [<code>%d</code>]\n\n<b>Join reason</b>: %s\n<b>Approved by</b>: %s\n<b>Approved at</b>: %s"
AdminDeclinedMsg = "❌ Join #request declined for %s< [<code>%d</code>]\n\n<b>Join reason</b>: %s\n<b>Declined by</b>: %s\n<b>Declined at</b>: %s\n<b>Declined reason</b>: %s"
AdminFailedMsg = "⚠️ Join #request failed for %s< [<code>%d</code>]\n\n<b>Join reason</b>: %s\n<b>Failure reason</b>: %s"
AdminJoinRequestMsg = "New join #request from %s [<code>%d</code>]\n\n<b>Join reason</b>: %s"
AdminApprovedMsg = "✅ Join #request approved for %s [<code>%d</code>]\n\n<b>Join reason</b>: %s\n<b>Approved by</b>: %s\n<b>Approved at</b>: %s"
AdminDeclinedMsg = "❌ Join #request declined for %s [<code>%d</code>]\n\n<b>Join reason</b>: %s\n<b>Declined by</b>: %s\n<b>Declined at</b>: %s\n<b>Declined reason</b>: %s"
AdminFailedMsg = "⚠️ Join #request failed for %s [<code>%d</code>]\n\n<b>Join reason</b>: %s\n<b>Failure reason</b>: %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
}