Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
chr233 committed Nov 24, 2023
1 parent 6bd8dbb commit 2c42fe9
Show file tree
Hide file tree
Showing 25 changed files with 804 additions and 950 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>2.2.4.4</Version>
<Version>2.2.4.5</Version>
</PropertyGroup>

<PropertyGroup>
Expand Down
8 changes: 4 additions & 4 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageVersion Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.5" />
<PackageVersion Include="MySql.Data" Version="8.2.0" />
<PackageVersion Include="NLog" Version="5.2.5" />
<PackageVersion Include="NLog" Version="5.2.6" />
<PackageVersion Include="NLog.Extensions.Logging" Version="5.3.5" />
<PackageVersion Include="NLog.Web.AspNetCore" Version="5.3.5" />
<PackageVersion Include="Quartz" Version="3.7.0" />
<PackageVersion Include="Quartz.AspNetCore" Version="3.7.0" />
<PackageVersion Include="Quartz" Version="3.8.0" />
<PackageVersion Include="Quartz.AspNetCore" Version="3.8.0" />
<PackageVersion Include="SqlSugar.IOC" Version="2.0.0" />
<PackageVersion Include="SqlSugarCore" Version="5.1.4.118-preview01" />
<PackageVersion Include="SqlSugarCore" Version="5.1.4.125-preview02" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageVersion Include="Swashbuckle.AspNetCore.Annotations" Version="6.5.0" />
<PackageVersion Include="Telegram.Bot" Version="20.0.0-alpha.1" />
Expand Down
247 changes: 106 additions & 141 deletions XinjingdailyBot.Command/AdminCommand.cs

Large diffs are not rendered by default.

33 changes: 9 additions & 24 deletions XinjingdailyBot.Command/CommonCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,15 @@ namespace XinjingdailyBot.Command;
/// 通用命令
/// </summary>
[AppService(LifeTime.Scoped)]
internal class CommonCommand
internal class CommonCommand(
ITelegramBotClient _botClient,
IOptions<OptionsSetting> _configuration,
IBanRecordService _banRecordService,
ITextHelperService _textHelperService,
ICommandHandler _commandHandler,
IChannelService _channelService)
{
private readonly ITelegramBotClient _botClient;
private readonly OptionsSetting _optionsSetting;
private readonly IBanRecordService _banRecordService;
private readonly ITextHelperService _textHelperService;
private readonly ICommandHandler _commandHandler;
private readonly IChannelService _channelService;

public CommonCommand(
ITelegramBotClient botClient,
IOptions<OptionsSetting> options,
IBanRecordService banRecordService,
ITextHelperService textHelperService,
ICommandHandler commandHandler,
IChannelService channelService)
{
_botClient = botClient;
_optionsSetting = options.Value;
_banRecordService = banRecordService;
_textHelperService = textHelperService;
_commandHandler = commandHandler;
_channelService = channelService;
}
private readonly OptionsSetting _optionsSetting = _configuration.Value;

/// <inheritdoc cref="IBanRecordService.WarnDuration"/>
private readonly int WarnDuration = IBanRecordService.WarnDuration;
Expand Down Expand Up @@ -163,7 +148,7 @@ public async Task ResponseMyBan(Users dbUser, Message message)
{
sb.AppendLine("查询封禁/解封记录出错");
}
else if (!records.Any())
else if (records.Count == 0)
{
sb.AppendLine("尚未查到封禁/解封/警告记录");
}
Expand Down
46 changes: 11 additions & 35 deletions XinjingdailyBot.Command/NormalCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,42 +19,18 @@ namespace XinjingdailyBot.Command;
/// 通用命令
/// </summary>
[AppService(LifeTime.Scoped)]
internal class NormalCommand
internal class NormalCommand(
ILogger<NormalCommand> _logger,
ITelegramBotClient _botClient,
IUserService _userService,
GroupRepository _groupRepository,
IMarkupHelperService _markupHelperService,
IAttachmentService _attachmentService,
IPostService _postService,
TagRepository _tagRepository,
IHttpHelperService _httpHelperService,
IMediaGroupService _mediaGroupService)
{
private readonly ILogger<NormalCommand> _logger;
private readonly ITelegramBotClient _botClient;
private readonly IUserService _userService;
private readonly GroupRepository _groupRepository;
private readonly IMarkupHelperService _markupHelperService;
private readonly IAttachmentService _attachmentService;
private readonly IPostService _postService;
private readonly TagRepository _tagRepository;
private readonly IHttpHelperService _httpHelperService;
private readonly IMediaGroupService _mediaGroupService;

public NormalCommand(
ILogger<NormalCommand> logger,
ITelegramBotClient botClient,
IUserService userService,
GroupRepository groupRepository,
IMarkupHelperService markupHelperService,
IAttachmentService attachmentService,
IPostService postService,
TagRepository tagRepository,
IHttpHelperService httpHelperService,
IMediaGroupService mediaGroupService)
{
_logger = logger;
_botClient = botClient;
_userService = userService;
_groupRepository = groupRepository;
_markupHelperService = markupHelperService;
_attachmentService = attachmentService;
_postService = postService;
_tagRepository = tagRepository;
_httpHelperService = httpHelperService;
_mediaGroupService = mediaGroupService;
}

/// <summary>
/// 检测机器人是否存活
Expand Down
Loading

0 comments on commit 2c42fe9

Please sign in to comment.