Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
chr233 committed Feb 22, 2023
1 parent 8b29115 commit d106451
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
9 changes: 1 addition & 8 deletions XinjingdailyBot.Command/NormalCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

//去除第一条消息的按钮
Expand Down
2 changes: 1 addition & 1 deletion XinjingdailyBot.Service/Bot/Handler/CommandHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions XinjingdailyBot.Service/Helper/MarkupHelperService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public InlineKeyboardMarkup DirectPostKeyboard(bool anymouse, int tagNum, bool?
List<IEnumerable<InlineKeyboardButton>> btns = new();
List<InlineKeyboardButton> line = new();

int lineCount = tags.Count() <= 6 ? 2 : 3;
int lineCount = tags.Count() <= 4 ? 2 : 3;

foreach (var tag in tags)
{
Expand Down Expand Up @@ -116,7 +116,7 @@ public InlineKeyboardMarkup ReviewKeyboardA(int tagNum, bool? hasSpoiler)
List<IEnumerable<InlineKeyboardButton>> btns = new();
List<InlineKeyboardButton> line = new();

int lineCount = tags.Count() <= 6 ? 2 : 3;
int lineCount = tags.Count() <= 4 ? 2 : 3;

foreach (var tag in tags)
{
Expand Down Expand Up @@ -366,7 +366,7 @@ public InlineKeyboardMarkup RandomPostMenuKeyboard(Users dbUser)
};
List<InlineKeyboardButton> line = new();

int lineCount = tags.Count() <= 6 ? 2 : 3;
int lineCount = tags.Count() <= 4 ? 2 : 3;

foreach (var tag in tags)
{
Expand Down

0 comments on commit d106451

Please sign in to comment.