* Added StartReceiving method as ITelegratoBot interface member

* Added missing summaries
* Fixed compiler warning and infos
* Code cleanup and bugfixes
This commit is contained in:
gutii
2026-04-27 22:13:47 +04:00
parent 5433a2de0d
commit 96b3241716
21 changed files with 379 additions and 68 deletions
@@ -0,0 +1,8 @@
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
using System.Diagnostics.CodeAnalysis;
[assembly: SuppressMessage("Roslynator", "RCS1037")]
+1 -1
View File
@@ -32,7 +32,7 @@ internal static class Program
ApplicationName = "WBot example",
});
using DbConnection connection = new SqliteConnection(@"Data Source=wtgb.db");
using DbConnection connection = new SqliteConnection("Data Source=wtgb.db");
builder.Services.ConfigureWideTelegram(
new WTelegramBotClientOptions(token: "BOT_TOKEN", apiId: 123, apiHash: "API_HASH", dbConnection: connection));
+15 -17
View File
@@ -1,23 +1,21 @@
using Telegram.Bot.Types;
using Telegrator.Handlers;
namespace Telegrator.Tests
{
/// <summary>
/// Вспомогательный класс для тестирования абстрактного UpdateHandlerBase.
///
/// ПРИНЦИП: Создание тестовых двойников для абстрактных классов
/// </summary>
[MessageHandler]
internal class TestUpdateHandler : MessageHandler
{
public bool WasExecuted { get; private set; }
namespace Telegrator.Tests;
public override Task<Result> Execute(IHandlerContainer<Message> container, CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
WasExecuted = true;
return Task.FromResult(Result.Ok());
}
/// <summary>
/// Вспомогательный класс для тестирования абстрактного UpdateHandlerBase.
/// ПРИНЦИП: Создание тестовых двойников для абстрактных классов
/// </summary>
[MessageHandler]
internal class TestUpdateHandler : MessageHandler
{
public bool WasExecuted { get; private set; }
public override Task<Result> Execute(IHandlerContainer<Message> container, CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
WasExecuted = true;
return Task.FromResult(Result.Ok());
}
}