* Added StartReceiving method as ITelegratoBot interface member
* Added missing summaries * Fixed compiler warning and infos * Code cleanup and bugfixes
This commit is contained in:
@@ -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")]
|
||||
@@ -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));
|
||||
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user