Skip to content

Commit

Permalink
update 代码格式修正
Browse files Browse the repository at this point in the history
  • Loading branch information
chr233 committed Mar 27, 2023
1 parent 5bb3ee9 commit 2301bc2
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 20 deletions.
2 changes: 1 addition & 1 deletion XinjingdailyBot.Command/NormalCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ public async Task QGetRandomPost(Users dbUser, CallbackQuery callbackQuery, stri
}

[TextCmd("IP", UserRights.NormalCmd, Alias = "IPINFO", Description = "查询IP信息")]
public async Task GetIpInfo(Users dbUser, Message message, string[] args)
public async Task GetIpInfo(Message message, string[] args)
{
StringBuilder sb = new();
if (args.Length < 1)
Expand Down
5 changes: 2 additions & 3 deletions XinjingdailyBot.Infrastructure/Extensions/ChatExtension.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Threading.Channels;
using Telegram.Bot.Types;
using Telegram.Bot.Types;

namespace XinjingdailyBot.Infrastructure.Extensions
{
Expand Down Expand Up @@ -35,7 +34,7 @@ public static string EscapedChatName(this Chat chat)
return chat.Title?.EscapeHtml() ?? "";
}

public static string GetMessageLink (this Chat chat,long messageId)
public static string GetMessageLink(this Chat chat, long messageId)
{
string link = !string.IsNullOrEmpty(chat.Username) ? $"https://t.me/{chat.Username}/{messageId}" : $"https://t.me/c/{chat.Id}/{messageId}";
return link;
Expand Down
18 changes: 9 additions & 9 deletions XinjingdailyBot.Infrastructure/Model/IpInfoResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,31 @@ public sealed record IpInfoResponse
{
[JsonPropertyName("ip")]
public string? Ip { get; set; }

[JsonPropertyName("hostname")]
public string? Hostname { get; set; }

[JsonPropertyName("anycast")]
public bool AnyCast { get; set; }

[JsonPropertyName("city")]
public string? City { get; set; }

[JsonPropertyName("region")]
public string? Region { get; set; }

[JsonPropertyName("country")]
public string? Country { get; set; }

[JsonPropertyName("loc")]
public string? Loc { get; set; }

[JsonPropertyName("org")]
public string? Org { get; set; }

[JsonPropertyName("postal")]
public string? Postal { get; set; }

[JsonPropertyName("timezone")]
public string? Timezone { get; set; }
}
Expand Down
5 changes: 0 additions & 5 deletions XinjingdailyBot.Service/Bot/Common/DispatcherService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums;
using XinjingdailyBot.Infrastructure.Attribute;
using XinjingdailyBot.Infrastructure.Localization;
using XinjingdailyBot.Interface.Bot.Common;
using XinjingdailyBot.Interface.Bot.Handler;
using XinjingdailyBot.Interface.Data;
using XinjingdailyBot.Interface.Helper;
using XinjingdailyBot.Model.Models;
using XinjingdailyBot.Repository;

Expand All @@ -21,7 +19,6 @@ internal class DispatcherService : IDispatcherService
private readonly ICommandHandler _commandHandler;
private readonly IChannelPostHandler _channelPostHandler;
private readonly IChannelService _channelService;
private readonly ITextHelperService _textHelperService;
private readonly ITelegramBotClient _botClient;
private readonly IJoinRequestHandler _joinRequestHandler;
private readonly IInlineQueryHandler _inlineQueryHandler;
Expand All @@ -34,7 +31,6 @@ public DispatcherService(
ICommandHandler commandHandler,
IChannelPostHandler channelPostHandler,
IChannelService channelService,
ITextHelperService textHelperService,
ITelegramBotClient botClient,
IJoinRequestHandler joinRequestHandler,
IInlineQueryHandler inlineQueryHandler,
Expand All @@ -46,7 +42,6 @@ public DispatcherService(
_commandHandler = commandHandler;
_channelPostHandler = channelPostHandler;
_channelService = channelService;
_textHelperService = textHelperService;
_botClient = botClient;
_joinRequestHandler = joinRequestHandler;
_inlineQueryHandler = inlineQueryHandler;
Expand Down
2 changes: 1 addition & 1 deletion XinjingdailyBot.Service/Bot/Common/PollingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private async Task DoWork(CancellationToken stoppingToken)

catch (Exception ex)
{
_logger.LogError(ex,"接收服务运行出错");
_logger.LogError(ex, "接收服务运行出错");
await Task.Delay(TimeSpan.FromSeconds(5), stoppingToken);
}
}
Expand Down
1 change: 0 additions & 1 deletion XinjingdailyBot.Service/Bot/Handler/ChannelPostHandler.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.Concurrent;
using System.ComponentModel;
using Microsoft.Extensions.Logging;
using Telegram.Bot;
using Telegram.Bot.Types;
Expand Down

0 comments on commit 2301bc2

Please sign in to comment.