diff --git a/src/plugins/system/callback_handle.go b/src/plugins/system/callback_handle.go index 65e6205..f9124c2 100644 --- a/src/plugins/system/callback_handle.go +++ b/src/plugins/system/callback_handle.go @@ -14,7 +14,7 @@ func Report(callBack tgbotapi.Update) error { data := callBack.CallbackData() d := strings.Split(data, ",") - if len(d) < 3 { + if len(d) < 4 { return nil } @@ -22,6 +22,7 @@ func Report(callBack tgbotapi.Update) error { chatId := callbackQuery.Message.Chat.ID messageId := callbackQuery.Message.MessageID target, _ := strconv.ParseInt(d[2], 10, 64) + targetMessageId, _ := strconv.Atoi(d[3]) if !utils.IsAdmin(chatId, userId) { answer := tgbotapi.NewCallbackWithAlert(callbackQuery.ID, "无使用权限!") @@ -38,7 +39,9 @@ func Report(callBack tgbotapi.Update) error { RevokeMessages: true, } bot.Arknights.Send(banChatMemberConfig) - delMsg := tgbotapi.NewDeleteMessage(chatId, messageId) + delMsg := tgbotapi.NewDeleteMessage(chatId, targetMessageId) + bot.Arknights.Send(delMsg) + delMsg = tgbotapi.NewDeleteMessage(chatId, messageId) bot.Arknights.Send(delMsg) } diff --git a/src/plugins/system/report_handle.go b/src/plugins/system/report_handle.go index fe5c7d6..20c3588 100644 --- a/src/plugins/system/report_handle.go +++ b/src/plugins/system/report_handle.go @@ -57,8 +57,8 @@ func ReportHandle(update tgbotapi.Update) error { } buttons = append(buttons, tgbotapi.NewInlineKeyboardRow( - tgbotapi.NewInlineKeyboardButtonData("🚫封禁", fmt.Sprintf("report,%s,%d", "BAN", target)), - tgbotapi.NewInlineKeyboardButtonData("❌关闭", fmt.Sprintf("report,%s,%d", "CLOSE", target)), + tgbotapi.NewInlineKeyboardButtonData("🚫封禁", fmt.Sprintf("report,%s,%d,%d", "BAN", target, replyMessageId)), + tgbotapi.NewInlineKeyboardButtonData("❌关闭", fmt.Sprintf("report,%s,%d,%d", "CLOSE", target, replyMessageId)), )) inlineKeyboardMarkup := tgbotapi.NewInlineKeyboardMarkup(