Skip to content

Commit

Permalink
Merge pull request #47 from RxTelegram/v7.4
Browse files Browse the repository at this point in the history
Add support for api v7.4
  • Loading branch information
niklasweimann authored May 31, 2024
2 parents c53ecfa + b26fb65 commit bbeb070
Show file tree
Hide file tree
Showing 42 changed files with 226 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=RxTelegram_RxTelegram.Bot&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=RxTelegram_RxTelegram.Bot)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=RxTelegram_RxTelegram.Bot&metric=coverage)](https://sonarcloud.io/summary/new_code?id=RxTelegram_RxTelegram.Bot)

RxTelegram.Bot supports Telegram Bot API 7.3 (as at May 6, 2024).
RxTelegram.Bot supports Telegram Bot API 7.4 (as at May 28, 2024).

This is a reactive designed .NET Library for the Telegram Bot API. It works with the official [Reactive Extentions](https://github.com/dotnet/reactive).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,10 @@ public enum MessageEntityType
/// <summary>
/// block quotation
/// </summary>
Blockquote
Blockquote,

/// <summary>
/// collapsed-by-default block quotation
/// </summary>
ExpandableBlockquote
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class ExternalReplyInfo
/// <summary>
/// Optional. Unique message identifier inside the original chat. Available only if the original chat is a supergroup or a channel.
/// </summary>
public long MessageId { get; set; }
public int MessageId { get; set; }

/// <summary>
/// Optional. Options used for link preview generation for the original message, if it is a text message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,9 @@ public InputMediaAnimation(Stream stream, string fileName = default) : base(stre
/// Optional. Pass True if the photo needs to be covered with a spoiler Animation
/// </summary>
public bool? HasSpoiler { get; set; }

/// <summary>
/// Optional. True, if the caption must be shown above the message media
/// </summary>
public bool ShowCaptionAboveMedia { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ public class InputMediaPhoto : BaseInputMedia
/// </summary>
public bool? HasSpoiler { get; set; }

/// <summary>
/// Optional. True, if the caption must be shown above the message media
/// </summary>
public bool ShowCaptionAboveMedia { get; set; }

public InputMediaPhoto(string fileId) : base(fileId)
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,9 @@ public InputMediaVideo(Stream stream, string fileName = default) : base(stream,
/// Optional. Pass True if the photo needs to be covered with a spoiler Animation
/// </summary>
public bool? HasSpoiler { get; set; }

/// <summary>
/// Optional. True, if the caption must be shown above the message media
/// </summary>
public bool ShowCaptionAboveMedia { get; set; }
}
10 changes: 10 additions & 0 deletions src/RxTelegram.Bot/Interface/BaseTypes/Message.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,21 @@ public class Message
/// </summary>
public LinkPreviewOptions LinkPreviewOptions { get; set; }

/// <summary>
/// Optional. Unique identifier of the message effect added to the message
/// </summary>
public string EffectId { get; set; }

/// <summary>
/// Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption
/// </summary>
public IEnumerable<MessageEntity> CaptionEntities { get; set; }

/// <summary>
/// Optional. True, if the caption must be shown above the message media
/// </summary>
public bool ShowCaptionAboveMedia { get; set; }

/// <summary>
/// Optional. Description is an audio file, information about the file
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class MessageOriginChannel : MessageOrigin
/// <summary>
/// Unique message identifier inside the chat
/// </summary>
public long MessageId { get; set; }
public int MessageId { get; set; }

/// <summary>
/// Optional. Signature of the original post author
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@ public class SendAnimation : BaseSend, IProtectContent
/// </summary>
public bool? HasSpoiler { get; set; }

/// <summary>
/// Unique identifier of the message effect to be added to the message; for private chats only
/// </summary>
public string MessageEffectId { get; set; }

/// <summary>
/// Optional. True, if the caption must be shown above the message media
/// </summary>
public bool ShowCaptionAboveMedia { get; set; }

/// <summary>
/// Protects the contents of the sent message from forwarding and saving
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ public class SendAudio : BaseSend, IProtectContent
/// </summary>
public IEnumerable<MessageEntity> CaptionEntities { get; set; }

/// <summary>
/// Unique identifier of the message effect to be added to the message; for private chats only
/// </summary>
public string MessageEffectId { get; set; }

/// <summary>
/// Protects the contents of the sent message from forwarding and saving
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ public class SendContact : BaseRequest, IProtectContent
/// </summary>
public IReplyMarkup ReplyMarkup { get; set; }

/// <summary>
/// Unique identifier of the message effect to be added to the message; for private chats only
/// </summary>
public string MessageEffectId { get; set; }

/// <summary>
/// Protects the contents of the sent message from forwarding and saving
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ public class SendDocument : BaseSend, IProtectContent
/// </summary>
public IEnumerable<MessageEntity> CaptionEntities { get; set; }

/// <summary>
/// Unique identifier of the message effect to be added to the message; for private chats only
/// </summary>
public string MessageEffectId { get; set; }

/// <summary>
/// Protects the contents of the sent message from forwarding and saving
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ public class SendLocation : BaseRequest, IProtectContent
/// </summary>
public IReplyMarkup ReplyMarkup { get; set; }

/// <summary>
/// Unique identifier of the message effect to be added to the message; for private chats only
/// </summary>
public string MessageEffectId { get; set; }

/// <summary>
/// Protects the contents of the sent message from forwarding and saving
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ public class SendMediaGroup : BaseRequest, IProtectContent
/// </summary>
public ReplyParameters ReplyParameters { get; set; }

/// <summary>
/// Unique identifier of the message effect to be added to the message; for private chats only
/// </summary>
public string MessageEffectId { get; set; }

/// <summary>
/// Protects the contents of the sent message from forwarding and saving
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ public class SendPhoto : BaseSend, IProtectContent
/// </summary>
public bool? HasSpoiler { get; set; }

/// <summary>
/// Unique identifier of the message effect to be added to the message; for private chats only
/// </summary>
public string MessageEffectId { get; set; }

/// <summary>
/// Optional. True, if the caption must be shown above the message media
/// </summary>
public bool ShowCaptionAboveMedia { get; set; }

/// <summary>
/// Protects the contents of the sent message from forwarding and saving
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ public class SendPoll : BaseRequest, IProtectContent
/// </summary>
public IEnumerable<MessageEntity> ExplanationEntities { get; set; }

/// <summary>
/// Unique identifier of the message effect to be added to the message; for private chats only
/// </summary>
public string MessageEffectId { get; set; }

/// <summary>
/// Protects the contents of the sent message from forwarding and saving
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ public class SendVenue : BaseRequest, IProtectContent
/// </summary>
public IReplyMarkup ReplyMarkup { get; set; }

/// <summary>
/// Unique identifier of the message effect to be added to the message; for private chats only
/// </summary>
public string MessageEffectId { get; set; }

/// <summary>
/// Protects the contents of the sent message from forwarding and saving
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@ public class SendVideo : BaseSend, IProtectContent
/// </summary>
public bool? HasSpoiler { get; set; }

/// <summary>
/// Unique identifier of the message effect to be added to the message; for private chats only
/// </summary>
public string MessageEffectId { get; set; }

/// <summary>
/// Optional. True, if the caption must be shown above the message media
/// </summary>
public bool ShowCaptionAboveMedia { get; set; }

/// <summary>
/// Protects the contents of the sent message from forwarding and saving
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ public class SendVideoNote : BaseSend, IProtectContent
/// </summary>
public InputFile Thumbnail { get; set; }

/// <summary>
/// Unique identifier of the message effect to be added to the message; for private chats only
/// </summary>
public string MessageEffectId { get; set; }

/// <summary>
/// Protects the contents of the sent message from forwarding and saving
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ public class SendVoice : BaseSend, IProtectContent
/// </summary>
public IEnumerable<MessageEntity> CaptionEntities { get; set; }

/// <summary>
/// Unique identifier of the message effect to be added to the message; for private chats only
/// </summary>
public string MessageEffectId { get; set; }

/// <summary>
/// Protects the contents of the sent message from forwarding and saving
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,10 @@ public class CopyMessage : BaseSend, IProtectContent
/// </summary>
public bool? ProtectContent { get; set; }

/// <summary>
/// Optional. True, if the caption must be shown above the message media
/// </summary>
public bool ShowCaptionAboveMedia { get; set; }

protected override IValidationResult Validate() => this.CreateValidation();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,10 @@ public class EditMessageCaption : BaseTextRequest
/// </summary>
public IEnumerable<MessageEntity> CaptionEntities { get; set; }

/// <summary>
/// Optional. True, if the caption must be shown above the message media
/// </summary>
public bool ShowCaptionAboveMedia { get; set; }

protected override IValidationResult Validate() => this.CreateValidation();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ public class SendDice : BaseRequest, IProtectContent
/// </summary>
public IReplyMarkup ReplyMarkup { get; set; }

/// <summary>
/// Unique identifier of the message effect to be added to the message; for private chats only
/// </summary>
public string MessageEffectId { get; set; }

/// <summary>
/// Protects the contents of the sent message from forwarding and saving
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ public class SendMessage : BaseTextRequest, IProtectContent
/// </summary>
public bool? DisableNotification { get; set; }

/// <summary>
/// Unique identifier of the message effect to be added to the message; for private chats only
/// </summary>
public string MessageEffectId { get; set; }

/// <summary>
/// Description of the message to reply to
/// </summary>
Expand Down
5 changes: 5 additions & 0 deletions src/RxTelegram.Bot/Interface/Games/Requests/SendGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ public class SendGame : BaseRequest, IProtectContent
/// </summary>
public InlineKeyboardMarkup Type { get; set; }

/// <summary>
/// Unique identifier of the message effect to be added to the message; for private chats only
/// </summary>
public string MessageEffectId { get; set; }

/// <summary>
/// Protects the contents of the sent message from forwarding and saving
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,10 @@ public class InlineQueryResultCachedGif : BaseInlineQueryResultMedia
/// </summary>
public ParseMode ParseMode { get; set; }

/// <summary>
/// Optional. True, if the caption must be shown above the message media
/// </summary>
public bool ShowCaptionAboveMedia { get; set; }

protected override IValidationResult Validate() => this.CreateValidation();
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,10 @@ public class InlineQueryResultCachedMpeg4Gif : BaseInlineQueryResultMedia
/// </summary>
public ParseMode ParseMode { get; set; }

/// <summary>
/// Optional. True, if the caption must be shown above the message media
/// </summary>
public bool ShowCaptionAboveMedia { get; set; }

protected override IValidationResult Validate() => this.CreateValidation();
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,10 @@ public class InlineQueryResultCachedPhoto : BaseInlineQueryResultMedia
/// </summary>
public ParseMode ParseMode { get; set; }

/// <summary>
/// Optional. True, if the caption must be shown above the message media
/// </summary>
public bool ShowCaptionAboveMedia { get; set; }

protected override IValidationResult Validate() => this.CreateValidation();
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,10 @@ public class InlineQueryResultCachedVideo : BaseInlineQueryResultMedia
/// </summary>
public ParseMode ParseMode { get; set; }

/// <summary>
/// Optional. True, if the caption must be shown above the message media
/// </summary>
public bool ShowCaptionAboveMedia { get; set; }

protected override IValidationResult Validate() => this.CreateValidation();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,10 @@ public class InlineQueryResultGif : BaseInlineQueryResultMedia
/// </summary>
public ParseMode ParseMode { get; set; }

/// <summary>
/// Optional. True, if the caption must be shown above the message media
/// </summary>
public bool ShowCaptionAboveMedia { get; set; }

protected override IValidationResult Validate() => this.CreateValidation();
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,10 @@ public class InlineQueryResultMpeg4Gif : BaseInlineQueryResultMedia
/// </summary>
public ParseMode ParseMode { get; set; }

/// <summary>
/// Optional. True, if the caption must be shown above the message media
/// </summary>
public bool ShowCaptionAboveMedia { get; set; }

protected override IValidationResult Validate() => this.CreateValidation();
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,10 @@ public class InlineQueryResultPhoto : BaseInlineQueryResultMedia
/// </summary>
public ParseMode ParseMode { get; set; }

/// <summary>
/// Optional. True, if the caption must be shown above the message media
/// </summary>
public bool ShowCaptionAboveMedia { get; set; }

protected override IValidationResult Validate() => this.CreateValidation();
}
}
Loading

0 comments on commit bbeb070

Please sign in to comment.