@@ -145,7 +145,7 @@ protected override async Task<SendMessageResponse> InnerSendMessageAsync<TSendOp
145145
146146 var text = new StringBuilder ( $ "{ request . Message . Subject } { request . Message . Body } ") ;
147147 var retText = Escape ( text ) . ToString ( ) ;
148- List < ( string chatId , string innerId ) > pairs = new ( ) ;
148+ List < ( string chatId , string innerId ) > pairs = [ ] ;
149149
150150 foreach ( var link in request . Message . ChatIdInnerIdLinks )
151151 pairs . AddRange ( link . Value . Select ( innerId => ( link . Key , innerId ) ) ) ;
@@ -170,7 +170,7 @@ protected override async Task<SendMessageResponse> InnerSendMessageAsync<TSendOp
170170 else
171171 {
172172 Logger . LogWarning ( @"Streaming output isn't supported for Telegram now!" ) ;
173- await SendText ( @"Sorry, but streaming output isn't supported for Telegram now\ !" ) ;
173+ await SendText ( @"Sorry, but streaming output isn't supported for Telegram now!" ) ;
174174 }
175175
176176 async Task SendText ( string sendText )
@@ -403,7 +403,7 @@ private static StringBuilder Escape(StringBuilder text) =>
403403 /// <param name="request"></param>
404404 /// <param name="token"></param>
405405 /// <returns></returns>
406- protected override async Task < StartBotResponse > InnerStartBotAsync ( StartBotRequest request , CancellationToken token )
406+ protected override Task < StartBotResponse > InnerStartBotAsync ( StartBotRequest request , CancellationToken token )
407407 {
408408 try
409409 {
@@ -414,7 +414,7 @@ protected override async Task<StartBotResponse> InnerStartBotAsync(StartBotReque
414414 {
415415 Logger . LogInformation ( $ "{ nameof ( StartBotAsync ) } : already started") ;
416416
417- return response ;
417+ return Task . FromResult ( response ) ;
418418 }
419419
420420 BotStatusKeeper . IsStarted = true ;
@@ -430,14 +430,14 @@ protected override async Task<StartBotResponse> InnerStartBotAsync(StartBotReque
430430
431431 Logger . LogInformation ( $ "{ nameof ( StartBotAsync ) } : started") ;
432432
433- return response ;
433+ return Task . FromResult ( response ) ;
434434 }
435435 catch ( Exception ex )
436436 {
437437 Logger . LogError ( ex , ex . Message ) ;
438438 }
439439
440- return StartBotResponse . GetInstance ( AdminCommandStatus . Fail , "error" ) ;
440+ return Task . FromResult ( StartBotResponse . GetInstance ( AdminCommandStatus . Fail , "error" ) ) ;
441441 }
442442
443443 /// <summary>
@@ -487,10 +487,7 @@ public override async Task SetBotKey(string key, CancellationToken token)
487487 }
488488 }
489489
490- private void RecreateClient ( string key )
491- {
492- _client = new TelegramBotClient ( key ) ;
493- }
490+ private void RecreateClient ( string key ) => _client = new TelegramBotClient ( key ) ;
494491
495492 private async Task StartBot ( CancellationToken token )
496493 {
0 commit comments