From 26269d30f96191aea3d35694273b2554a173727d Mon Sep 17 00:00:00 2001 From: Astra Date: Fri, 6 Feb 2026 10:33:11 +0000 Subject: [PATCH] Fix it so replying to declined works --- main.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index f4b0a19..50e3f03 100644 --- a/main.go +++ b/main.go @@ -80,7 +80,13 @@ func main() { if strings.Contains(repliedMsg.Text, "(no reason provided, reply to this to send one, prepend with + to also send to user)") { // now we need to make sure the one that declined it is the one replying lines := strings.Split(repliedMsg.Text, "\n") - if strings.TrimPrefix(lines[3], "Declined by: ") == update.Message.From.String() { + userString := "" + if update.Message.From.UserName != "" { + userString = "@" + update.Message.From.UserName + } else { + userString = fmt.Sprintf("%s %s", update.Message.From.FirstName, update.Message.From.LastName) + } + if strings.TrimPrefix(lines[3], "Declined by: ") == userString { reason := escapeHTML(update.Message.Text) userID, username, joinReason, declinedBy, declinedAt := GetInfoFromMsg(repliedMsg.Text) if strings.HasPrefix(update.Message.Text, "+") {