< Summary

Information
Class: Services.ApiServices.TelegramBotApi.TelegramPinnedMessage
Assembly: Services
File(s): /home/runner/work/Studio2Prod/Studio2Prod/AppRepository/ApiServices/TelegramBotApi/ITelegramNotifier.cs
Line coverage
100%
Covered lines: 1
Uncovered lines: 0
Coverable lines: 1
Total lines: 29
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_MessageId()100%11100%

File(s)

/home/runner/work/Studio2Prod/Studio2Prod/AppRepository/ApiServices/TelegramBotApi/ITelegramNotifier.cs

#LineLine coverage
 1namespace Services.ApiServices.TelegramBotApi;
 2
 3/// <summary>Закреплённое сообщение чата.</summary>
 64public sealed record TelegramPinnedMessage(long MessageId, string? Text, bool FromBot);
 5
 6/// <summary>Отправка сообщений в Telegram. Никогда не бросает исключений (кроме отмены) — уведомление не должно ломать 
 7public interface ITelegramNotifier
 8{
 9    bool IsConfigured { get; }
 10
 11    /// <summary>Куда уходят сообщения категории (чаты и темы форума по настройкам).</summary>
 12    IReadOnlyList<TelegramRoute> RoutesFor(TelegramChannel channel, bool critical = false);
 13
 14    /// <returns>true — Telegram принял сообщение хотя бы в один чат.</returns>
 15    Task<bool> SendAsync(TelegramMessage message, CancellationToken ct = default);
 16
 17    /// <summary>Отправка по конкретному маршруту (чат + тема); возвращает <c>message_id</c> или null при ошибке.</summa
 18    Task<long?> SendToRouteAsync(TelegramMessage message, TelegramRoute route, CancellationToken ct = default);
 19
 20    /// <summary>Правка текста сообщения (HTML). «Сообщение не изменилось» считается успехом.</summary>
 21    Task<bool> EditAsync(long chatId, long messageId, string html, CancellationToken ct = default);
 22
 23    Task<bool> PinAsync(long chatId, long messageId, bool silent = true, CancellationToken ct = default);
 24
 25    Task<bool> UnpinAsync(long chatId, long messageId, CancellationToken ct = default);
 26
 27    /// <summary>Последнее закреплённое сообщение чата (для восстановления состояния после рестарта).</summary>
 28    Task<TelegramPinnedMessage?> GetPinnedAsync(long chatId, CancellationToken ct = default);
 29}

Methods/Properties

get_MessageId()