Skip to content

Commit 8660760

Browse files
committed
Refactor: Move IHost implementation to IBot interface
The BotApp class no longer implements the IHost interface directly. Instead, the IBot interface now extends IHost, centralizing hosting responsibilities within the IBot interface. This change ensures that any class implementing IBot will also need to implement IHost. Additionally, the necessary using directive for Microsoft.Extensions.Hosting was added to IBot.cs.
1 parent 7927b81 commit 8660760

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Sources/TelegramBot/BotApp.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace TelegramBot
2020
/// <summary>
2121
/// Telegram bot application.
2222
/// </summary>
23-
public class BotApp : IBot, IHost
23+
public class BotApp : IBot
2424
{
2525
private bool _disposed = false;
2626
private readonly ILogger<BotApp> _logger;

Sources/TelegramBot/IBot.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
using System.Threading;
22
using TelegramBot.Controllers;
3+
using Microsoft.Extensions.Hosting;
34

45
namespace TelegramBot
56
{
67
/// <summary>
78
/// Interface for bot.
89
/// </summary>
9-
public interface IBot
10+
public interface IBot : IHost
1011
{
1112
/// <summary>
1213
/// Maps controllers inherited from <see cref="BotControllerBase"/>.

0 commit comments

Comments
 (0)