< Summary

Information
Class: Services.ApiServices.TelegramBotApi.Models.UnpinChatMessageRequest
Assembly: Services
File(s): /home/runner/work/Studio2Prod/Studio2Prod/AppRepository/ApiServices/TelegramBotApi/Models/TelegramModels.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 2
Coverable lines: 2
Total lines: 101
Line coverage: 0%
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_ChatId()100%210%
get_MessageId()100%210%

File(s)

/home/runner/work/Studio2Prod/Studio2Prod/AppRepository/ApiServices/TelegramBotApi/Models/TelegramModels.cs

#LineLine coverage
 1using Newtonsoft.Json;
 2
 3namespace Services.ApiServices.TelegramBotApi.Models;
 4
 5/// <summary>Конверт ответа Bot API: <c>ok</c> + <c>result</c> либо <c>description</c>/<c>error_code</c>.</summary>
 6public class TelegramEnvelope<T>
 7{
 8    [JsonProperty("ok")] public bool Ok { get; set; }
 9    [JsonProperty("result")] public T? Result { get; set; }
 10    [JsonProperty("description")] public string? Description { get; set; }
 11    [JsonProperty("error_code")] public int? ErrorCode { get; set; }
 12}
 13
 14public class TelegramBotInfo
 15{
 16    [JsonProperty("id")] public long Id { get; set; }
 17    [JsonProperty("username")] public string? Username { get; set; }
 18    [JsonProperty("first_name")] public string? FirstName { get; set; }
 19}
 20
 21public class TelegramSentMessage
 22{
 23    [JsonProperty("message_id")] public long MessageId { get; set; }
 24}
 25
 26public class TelegramChat
 27{
 28    [JsonProperty("id")] public long Id { get; set; }
 29    [JsonProperty("type")] public string? Type { get; set; }
 30    [JsonProperty("title")] public string? Title { get; set; }
 31    [JsonProperty("username")] public string? Username { get; set; }
 32}
 33
 34public class TelegramUser
 35{
 36    [JsonProperty("id")] public long Id { get; set; }
 37    [JsonProperty("is_bot")] public bool IsBot { get; set; }
 38}
 39
 40/// <summary>Ответ <c>getChat</c>: нужен закреплённый пост (если он есть).</summary>
 41public class TelegramChatInfo
 42{
 43    [JsonProperty("id")] public long Id { get; set; }
 44    [JsonProperty("pinned_message")] public TelegramIncomingMessage? PinnedMessage { get; set; }
 45}
 46
 47public class TelegramIncomingMessage
 48{
 49    [JsonProperty("from")] public TelegramUser? From { get; set; }
 50    [JsonProperty("message_id")] public long MessageId { get; set; }
 51    [JsonProperty("chat")] public TelegramChat? Chat { get; set; }
 52    [JsonProperty("text")] public string? Text { get; set; }
 53}
 54
 55public class TelegramUpdate
 56{
 57    [JsonProperty("update_id")] public long UpdateId { get; set; }
 58    [JsonProperty("message")] public TelegramIncomingMessage? Message { get; set; }
 59}
 60
 61public class SendMessageRequest
 62{
 63    [JsonProperty("chat_id")] public long ChatId { get; set; }
 64    [JsonProperty("message_thread_id", NullValueHandling = NullValueHandling.Ignore)] public int? MessageThreadId { get;
 65    [JsonProperty("text")] public string Text { get; set; } = "";
 66    [JsonProperty("parse_mode", NullValueHandling = NullValueHandling.Ignore)] public string? ParseMode { get; set; }
 67    [JsonProperty("disable_notification")] public bool DisableNotification { get; set; }
 68    [JsonProperty("disable_web_page_preview")] public bool DisableWebPagePreview { get; set; } = true;
 69}
 70
 71public class SendPhotoRequest
 72{
 73    [JsonProperty("chat_id")] public long ChatId { get; set; }
 74    [JsonProperty("message_thread_id", NullValueHandling = NullValueHandling.Ignore)] public int? MessageThreadId { get;
 75    [JsonProperty("photo")] public string Photo { get; set; } = "";
 76    [JsonProperty("caption", NullValueHandling = NullValueHandling.Ignore)] public string? Caption { get; set; }
 77    [JsonProperty("parse_mode", NullValueHandling = NullValueHandling.Ignore)] public string? ParseMode { get; set; }
 78    [JsonProperty("disable_notification")] public bool DisableNotification { get; set; }
 79}
 80
 81public class EditMessageTextRequest
 82{
 83    [JsonProperty("chat_id")] public long ChatId { get; set; }
 84    [JsonProperty("message_id")] public long MessageId { get; set; }
 85    [JsonProperty("text")] public string Text { get; set; } = "";
 86    [JsonProperty("parse_mode", NullValueHandling = NullValueHandling.Ignore)] public string? ParseMode { get; set; }
 87    [JsonProperty("disable_web_page_preview")] public bool DisableWebPagePreview { get; set; } = true;
 88}
 89
 90public class PinChatMessageRequest
 91{
 92    [JsonProperty("chat_id")] public long ChatId { get; set; }
 93    [JsonProperty("message_id")] public long MessageId { get; set; }
 94    [JsonProperty("disable_notification")] public bool DisableNotification { get; set; } = true;
 95}
 96
 97public class UnpinChatMessageRequest
 98{
 099    [JsonProperty("chat_id")] public long ChatId { get; set; }
 0100    [JsonProperty("message_id")] public long MessageId { get; set; }
 101}

Methods/Properties

get_ChatId()
get_MessageId()