diff --git a/handlers/callbacks.go b/handlers/callbacks.go index 34dd76a..454fce1 100644 --- a/handlers/callbacks.go +++ b/handlers/callbacks.go @@ -162,9 +162,6 @@ func (bot *Bot) HandleDeclineReason(update *api.Update) { } userID, username, joinReason, declinedBy, declinedAt := utils.GetInfoFromMsg(repliedMsg.Text) - if entities, _ := utils.FilterEntitiesByTypeWithContext(repliedMsg, "italic"); len(entities) >= 1 { - username = fmt.Sprintf("%s", entities[0].Text) - } reason := utils.EscapeHTML(update.Message.Text) if strings.HasPrefix(update.Message.Text, "+") { @@ -175,6 +172,9 @@ func (bot *Bot) HandleDeclineReason(update *api.Update) { utils.EditMessage(bot.API, update.Message.Chat.ID, repliedMsg.MessageID, fmt.Sprintf(AdminDeclinedMsg, username, userID, joinReason, declinedBy, declinedAt, reason)) + + // Delete the admin's message after processing + bot.API.Send(api.NewDeleteMessage(update.Message.Chat.ID, update.Message.MessageID)) } // parseCallbackData parses the action and user ID from a callback query's data string.