Fix it so replying to declined works

This commit is contained in:
Astra 2026-02-06 10:33:11 +00:00
parent 49203653d5
commit 26269d30f9

View file

@ -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, "+") {