Remove extra <
This commit is contained in:
parent
71079d3444
commit
78a520efad
1 changed files with 11 additions and 5 deletions
16
main.go
16
main.go
|
|
@ -11,10 +11,10 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
AdminJoinRequestMsg = "New join #request from %s< [<code>%d</code>]\n\n<b>Join 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"
|
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"
|
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"
|
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 {
|
type ExtendedChatJoinRequest struct {
|
||||||
|
|
@ -53,6 +53,7 @@ func main() {
|
||||||
|
|
||||||
for update := range updatesChannel {
|
for update := range updatesChannel {
|
||||||
if update.ChatJoinRequest != nil {
|
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 {
|
if update.ChatJoinRequest.Chat.ID == b.Config.TargetChatId {
|
||||||
b.handleJoinRequest(update.ChatJoinRequest)
|
b.handleJoinRequest(update.ChatJoinRequest)
|
||||||
}
|
}
|
||||||
|
|
@ -148,7 +149,12 @@ func (bot *Bot) handleJoinRequest(request *api.ChatJoinRequest) {
|
||||||
if bot.Config.AdminChatTopicId != 0 {
|
if bot.Config.AdminChatTopicId != 0 {
|
||||||
m.MessageThreadID = bot.Config.AdminChatTopicId
|
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
|
bot.WaitingForApproval[request.From.ID].JoinRequestMessageID = r.MessageID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue