From d106451137cebd322f39c5e005280d6f30b1375d Mon Sep 17 00:00:00 2001 From: chr_ Date: Wed, 22 Feb 2023 11:09:02 +0800 Subject: [PATCH] update --- XinjingdailyBot.Command/NormalCommand.cs | 9 +-------- XinjingdailyBot.Service/Bot/Handler/CommandHandler.cs | 2 +- XinjingdailyBot.Service/Helper/MarkupHelperService.cs | 6 +++--- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/XinjingdailyBot.Command/NormalCommand.cs b/XinjingdailyBot.Command/NormalCommand.cs index ea39d897..f7af60c2 100644 --- a/XinjingdailyBot.Command/NormalCommand.cs +++ b/XinjingdailyBot.Command/NormalCommand.cs @@ -390,14 +390,7 @@ public async Task QGetRandomPost(Users dbUser, CallbackQuery callbackQuery, stri return; } - try - { - var message = await handler; - } - catch (Exception ex) - { - int i = 0; - } + var message = await handler; } //去除第一条消息的按钮 diff --git a/XinjingdailyBot.Service/Bot/Handler/CommandHandler.cs b/XinjingdailyBot.Service/Bot/Handler/CommandHandler.cs index f8b520e0..39551e6e 100644 --- a/XinjingdailyBot.Service/Bot/Handler/CommandHandler.cs +++ b/XinjingdailyBot.Service/Bot/Handler/CommandHandler.cs @@ -353,7 +353,7 @@ public async Task OnQueryCommandReceived(Users dbUser, CallbackQuery query) { await CallQueryCommandAsync(dbUser, query, type, method, args); } - catch (Exception ex) //无法捕获 TODO + catch (Exception ex) { errorMsg = $"{ex.GetType} {ex.Message}"; _logger.LogError(ex, "回调命令 {cmd} 执行出错", cmd); diff --git a/XinjingdailyBot.Service/Helper/MarkupHelperService.cs b/XinjingdailyBot.Service/Helper/MarkupHelperService.cs index ae8eae9c..1d9554a3 100644 --- a/XinjingdailyBot.Service/Helper/MarkupHelperService.cs +++ b/XinjingdailyBot.Service/Helper/MarkupHelperService.cs @@ -62,7 +62,7 @@ public InlineKeyboardMarkup DirectPostKeyboard(bool anymouse, int tagNum, bool? List> btns = new(); List line = new(); - int lineCount = tags.Count() <= 6 ? 2 : 3; + int lineCount = tags.Count() <= 4 ? 2 : 3; foreach (var tag in tags) { @@ -116,7 +116,7 @@ public InlineKeyboardMarkup ReviewKeyboardA(int tagNum, bool? hasSpoiler) List> btns = new(); List line = new(); - int lineCount = tags.Count() <= 6 ? 2 : 3; + int lineCount = tags.Count() <= 4 ? 2 : 3; foreach (var tag in tags) { @@ -366,7 +366,7 @@ public InlineKeyboardMarkup RandomPostMenuKeyboard(Users dbUser) }; List line = new(); - int lineCount = tags.Count() <= 6 ? 2 : 3; + int lineCount = tags.Count() <= 4 ? 2 : 3; foreach (var tag in tags) {