delete decline message

This commit is contained in:
Astra 2026-02-19 16:16:53 +00:00
parent f6cbac70ad
commit 6222bde903

View file

@ -162,9 +162,6 @@ func (bot *Bot) HandleDeclineReason(update *api.Update) {
} }
userID, username, joinReason, declinedBy, declinedAt := utils.GetInfoFromMsg(repliedMsg.Text) userID, username, joinReason, declinedBy, declinedAt := utils.GetInfoFromMsg(repliedMsg.Text)
if entities, _ := utils.FilterEntitiesByTypeWithContext(repliedMsg, "italic"); len(entities) >= 1 {
username = fmt.Sprintf("<i>%s</i>", entities[0].Text)
}
reason := utils.EscapeHTML(update.Message.Text) reason := utils.EscapeHTML(update.Message.Text)
if strings.HasPrefix(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, utils.EditMessage(bot.API, update.Message.Chat.ID, repliedMsg.MessageID,
fmt.Sprintf(AdminDeclinedMsg, username, userID, joinReason, declinedBy, declinedAt, reason)) 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. // parseCallbackData parses the action and user ID from a callback query's data string.