xmldoc of recent layers

This commit is contained in:
Wizou 2022-09-25 19:21:00 +02:00
parent f3f1b37b85
commit ec0285077e
3 changed files with 148 additions and 69 deletions

View file

@ -15,7 +15,8 @@ go to your **Project Properties > Debug > Environment variables**
and add at least these variables with adequate value: **api_id, api_hash, phone_number** and add at least these variables with adequate value: **api_id, api_hash, phone_number**
Remember that these are just simple example codes that you should adjust to your needs. Remember that these are just simple example codes that you should adjust to your needs.
In real production code, you might want to properly test the success of each operation or handle exceptions. In real production code, you might want to properly test the success of each operation or handle exceptions,
and avoid calling the same methods (like `Messages_GetAllChats`) repetitively.
WTelegramClient covers 100% of Telegram Client API, much more than the examples below: check the [full API methods list](https://corefork.telegram.org/methods)! WTelegramClient covers 100% of Telegram Client API, much more than the examples below: check the [full API methods list](https://corefork.telegram.org/methods)!
More examples can also be found in the [Examples folder](Examples) and in answers to [StackOverflow questions](https://stackoverflow.com/questions/tagged/wtelegramclient). More examples can also be found in the [Examples folder](Examples) and in answers to [StackOverflow questions](https://stackoverflow.com/questions/tagged/wtelegramclient).
@ -402,22 +403,31 @@ WTelegram.Helpers.Log = (lvl, str) => { };
```csharp ```csharp
const string old_password = "password"; // current password if any (unused otherwise) const string old_password = "password"; // current password if any (unused otherwise)
const string new_password = "new_password"; // or null to disable 2FA const string new_password = "new_password"; // or null to disable 2FA
var accountPassword = await client.Account_GetPassword(); var accountPwd = await client.Account_GetPassword();
var password = accountPassword.current_algo == null ? null : await WTelegram.Client.InputCheckPassword(accountPassword, old_password); var password = accountPwd.current_algo == null ? null : await WTelegram.Client.InputCheckPassword(accountPwd, old_password);
accountPassword.current_algo = null; // makes InputCheckPassword generate a new password accountPwd.current_algo = null; // makes InputCheckPassword generate a new password
var new_password_hash = new_password == null ? null : await WTelegram.Client.InputCheckPassword(accountPassword, new_password); var new_password_hash = new_password == null ? null : await WTelegram.Client.InputCheckPassword(accountPwd, new_password);
await client.Account_UpdatePasswordSettings(password, new Account_PasswordInputSettings await client.Account_UpdatePasswordSettings(password, new Account_PasswordInputSettings
{ {
flags = Account_PasswordInputSettings.Flags.has_new_algo, flags = Account_PasswordInputSettings.Flags.has_new_algo,
new_password_hash = new_password_hash?.A, new_password_hash = new_password_hash?.A,
new_algo = accountPassword.new_algo, new_algo = accountPwd.new_algo,
hint = "new password hint", hint = "new password hint",
}); });
``` ```
<a name="reaction"></a> <a name="database"></a><a name="sessionStore"></a><a name="customStore"></a>
<a name="pinned"></a> ### Store session data to database or elsewhere, instead of files
<a name="custom_emoji"></a>
If you don't want to store session data into files *(for example if your VPS Hosting doesn't allow that)*, or just for easier management,
you can choose to store the session data somewhere else, like in a database.
The WTelegram.Client constructor takes an optional `sessionStore` parameter to allow storing sessions in an alternate manner.
Use it to pass a custom Stream-derived class that will **read** (first initial call to Length & Read) and **store** (subsequent Writes) session data to database.
You can find an example for such custom session store in [Examples/Program_Heroku.cs](https://github.com/wiz0u/WTelegramClient/blob/master/Examples/Program_Heroku.cs#L61)
<a name="reaction"></a><a name="pinned"></a><a name="custom_emoji"></a>
### Fun with custom emojies and reactions on pinned messages ### Fun with custom emojies and reactions on pinned messages
```csharp ```csharp
// • Fetch all available standard emoji reactions // • Fetch all available standard emoji reactions
@ -430,7 +440,7 @@ var chat = chats.chats[1234567890]; // the chat we want
var full = await client.GetFullChat(chat); var full = await client.GetFullChat(chat);
Reaction reaction = full.full_chat.AvailableReactions switch Reaction reaction = full.full_chat.AvailableReactions switch
{ {
ChatReactionsSome some => some.reactions[0],// only some reactions are allowed => pick the first ChatReactionsSome some => some.reactions[0], // only some reactions are allowed => pick the first
ChatReactionsAll all => // all reactions are allowed in this chat ChatReactionsAll all => // all reactions are allowed in this chat
all.flags.HasFlag(ChatReactionsAll.Flags.allow_custom) && client.User.flags.HasFlag(TL.User.Flags.premium) all.flags.HasFlag(ChatReactionsAll.Flags.allow_custom) && client.User.flags.HasFlag(TL.User.Flags.premium)
? new ReactionCustomEmoji { document_id = 5190875290439525089 } // we can use custom emoji reactions here ? new ReactionCustomEmoji { document_id = 5190875290439525089 } // we can use custom emoji reactions here
@ -444,15 +454,21 @@ var messages = await client.Messages_Search<InputMessagesFilterPinned>(chat, lim
foreach (var msg in messages.Messages) foreach (var msg in messages.Messages)
await client.Messages_SendReaction(chat, msg.ID, reaction: new[] { reaction }); await client.Messages_SendReaction(chat, msg.ID, reaction: new[] { reaction });
``` ```
*Note: you can find custom emojies document ID via API methods like [Messages_GetFeaturedEmojiStickers](https://corefork.telegram.org/method/messages.getFeaturedEmojiStickers). Access hash is not required* *Note: you can find custom emoji document IDs via API methods like [Messages_GetFeaturedEmojiStickers](https://corefork.telegram.org/method/messages.getFeaturedEmojiStickers). Access hash is not required*
<a name="database"></a><a name="sessionStore"></a><a name="customStore"></a> <a name="forward"></a><a name="copy"></a>
### Store session data to database or elsewhere, instead of files ### Forward or copy a message to another chat
```csharp
// Determine which chats and message to forward/copy
var chats = await client.Messages_GetAllChats();
var from_chat = chats.chats[1234567890]; // source chat
var to_chat = chats.chats[1234567891]; // destination chat
var history = await client.Messages_GetHistory(from_chat, limit: 1);
var msg = history.Messages[0] as Message; // last message of source chat
If you don't want to store session data into files *(for example if your VPS Hosting doesn't allow that)*, or just for easier management, // • Forward the message (only the source message id is necessary)
you can choose to store the session data somewhere else, like in a database. await client.Messages_ForwardMessages(from_chat, new[] { msg.ID }, new[] { WTelegram.Helpers.RandomLong() }, to_chat);
The WTelegram.Client constructor takes an optional `sessionStore` parameter to allow storing sessions in an alternate manner. // • Copy the message (without the "Forwarded" header)
Use it to pass a custom Stream-derived class that will **read** (first initial call to Length & Read) and **store** (subsequent Writes) session data to database. await client.SendMessageAsync(to_chat, msg.message, msg.media?.ToInputMedia(), entities: msg.entities);
```
You can find an example for such custom session store in [Examples/Program_Heroku.cs](https://github.com/wiz0u/WTelegramClient/blob/master/Examples/Program_Heroku.cs#L61)

View file

@ -727,6 +727,7 @@ namespace TL
[IfFlag(19)] public string bot_inline_placeholder; [IfFlag(19)] public string bot_inline_placeholder;
/// <summary>Language code of the user</summary> /// <summary>Language code of the user</summary>
[IfFlag(22)] public string lang_code; [IfFlag(22)] public string lang_code;
/// <summary><a href="https://corefork.telegram.org/api/emoji-status">Emoji status</a></summary>
[IfFlag(30)] public EmojiStatus emoji_status; [IfFlag(30)] public EmojiStatus emoji_status;
[Flags] public enum Flags : uint [Flags] public enum Flags : uint
@ -3073,7 +3074,7 @@ namespace TL
[TLDef(0x1BB00451)] [TLDef(0x1BB00451)]
public class InputMessagesFilterPinned : MessagesFilter { } public class InputMessagesFilterPinned : MessagesFilter { }
/// <summary>Object contains info on events occurred. <para>Derived classes: <see cref="UpdateNewMessage"/>, <see cref="UpdateMessageID"/>, <see cref="UpdateDeleteMessages"/>, <see cref="UpdateUserTyping"/>, <see cref="UpdateChatUserTyping"/>, <see cref="UpdateChatParticipants"/>, <see cref="UpdateUserStatus"/>, <see cref="UpdateUserName"/>, <see cref="UpdateUserPhoto"/>, <see cref="UpdateNewEncryptedMessage"/>, <see cref="UpdateEncryptedChatTyping"/>, <see cref="UpdateEncryption"/>, <see cref="UpdateEncryptedMessagesRead"/>, <see cref="UpdateChatParticipantAdd"/>, <see cref="UpdateChatParticipantDelete"/>, <see cref="UpdateDcOptions"/>, <see cref="UpdateNotifySettings"/>, <see cref="UpdateServiceNotification"/>, <see cref="UpdatePrivacy"/>, <see cref="UpdateUserPhone"/>, <see cref="UpdateReadHistoryInbox"/>, <see cref="UpdateReadHistoryOutbox"/>, <see cref="UpdateWebPage"/>, <see cref="UpdateReadMessagesContents"/>, <see cref="UpdateChannelTooLong"/>, <see cref="UpdateChannel"/>, <see cref="UpdateNewChannelMessage"/>, <see cref="UpdateReadChannelInbox"/>, <see cref="UpdateDeleteChannelMessages"/>, <see cref="UpdateChannelMessageViews"/>, <see cref="UpdateChatParticipantAdmin"/>, <see cref="UpdateNewStickerSet"/>, <see cref="UpdateStickerSetsOrder"/>, <see cref="UpdateStickerSets"/>, <see cref="UpdateSavedGifs"/>, <see cref="UpdateBotInlineQuery"/>, <see cref="UpdateBotInlineSend"/>, <see cref="UpdateEditChannelMessage"/>, <see cref="UpdateBotCallbackQuery"/>, <see cref="UpdateEditMessage"/>, <see cref="UpdateInlineBotCallbackQuery"/>, <see cref="UpdateReadChannelOutbox"/>, <see cref="UpdateDraftMessage"/>, <see cref="UpdateReadFeaturedStickers"/>, <see cref="UpdateRecentStickers"/>, <see cref="UpdateConfig"/>, <see cref="UpdatePtsChanged"/>, <see cref="UpdateChannelWebPage"/>, <see cref="UpdateDialogPinned"/>, <see cref="UpdatePinnedDialogs"/>, <see cref="UpdateBotWebhookJSON"/>, <see cref="UpdateBotWebhookJSONQuery"/>, <see cref="UpdateBotShippingQuery"/>, <see cref="UpdateBotPrecheckoutQuery"/>, <see cref="UpdatePhoneCall"/>, <see cref="UpdateLangPackTooLong"/>, <see cref="UpdateLangPack"/>, <see cref="UpdateFavedStickers"/>, <see cref="UpdateChannelReadMessagesContents"/>, <see cref="UpdateContactsReset"/>, <see cref="UpdateChannelAvailableMessages"/>, <see cref="UpdateDialogUnreadMark"/>, <see cref="UpdateMessagePoll"/>, <see cref="UpdateChatDefaultBannedRights"/>, <see cref="UpdateFolderPeers"/>, <see cref="UpdatePeerSettings"/>, <see cref="UpdatePeerLocated"/>, <see cref="UpdateNewScheduledMessage"/>, <see cref="UpdateDeleteScheduledMessages"/>, <see cref="UpdateTheme"/>, <see cref="UpdateGeoLiveViewed"/>, <see cref="UpdateLoginToken"/>, <see cref="UpdateMessagePollVote"/>, <see cref="UpdateDialogFilter"/>, <see cref="UpdateDialogFilterOrder"/>, <see cref="UpdateDialogFilters"/>, <see cref="UpdatePhoneCallSignalingData"/>, <see cref="UpdateChannelMessageForwards"/>, <see cref="UpdateReadChannelDiscussionInbox"/>, <see cref="UpdateReadChannelDiscussionOutbox"/>, <see cref="UpdatePeerBlocked"/>, <see cref="UpdateChannelUserTyping"/>, <see cref="UpdatePinnedMessages"/>, <see cref="UpdatePinnedChannelMessages"/>, <see cref="UpdateChat"/>, <see cref="UpdateGroupCallParticipants"/>, <see cref="UpdateGroupCall"/>, <see cref="UpdatePeerHistoryTTL"/>, <see cref="UpdateChatParticipant"/>, <see cref="UpdateChannelParticipant"/>, <see cref="UpdateBotStopped"/>, <see cref="UpdateGroupCallConnection"/>, <see cref="UpdateBotCommands"/>, <see cref="UpdatePendingJoinRequests"/>, <see cref="UpdateBotChatInviteRequester"/>, <see cref="UpdateMessageReactions"/>, <see cref="UpdateAttachMenuBots"/>, <see cref="UpdateWebViewResultSent"/>, <see cref="UpdateBotMenuButton"/>, <see cref="UpdateSavedRingtones"/>, <see cref="UpdateTranscribedAudio"/>, <see cref="UpdateReadFeaturedEmojiStickers"/></para> <para>See <a href="https://corefork.telegram.org/type/Update"/></para></summary> /// <summary>Object contains info on events occurred. <para>Derived classes: <see cref="UpdateNewMessage"/>, <see cref="UpdateMessageID"/>, <see cref="UpdateDeleteMessages"/>, <see cref="UpdateUserTyping"/>, <see cref="UpdateChatUserTyping"/>, <see cref="UpdateChatParticipants"/>, <see cref="UpdateUserStatus"/>, <see cref="UpdateUserName"/>, <see cref="UpdateUserPhoto"/>, <see cref="UpdateNewEncryptedMessage"/>, <see cref="UpdateEncryptedChatTyping"/>, <see cref="UpdateEncryption"/>, <see cref="UpdateEncryptedMessagesRead"/>, <see cref="UpdateChatParticipantAdd"/>, <see cref="UpdateChatParticipantDelete"/>, <see cref="UpdateDcOptions"/>, <see cref="UpdateNotifySettings"/>, <see cref="UpdateServiceNotification"/>, <see cref="UpdatePrivacy"/>, <see cref="UpdateUserPhone"/>, <see cref="UpdateReadHistoryInbox"/>, <see cref="UpdateReadHistoryOutbox"/>, <see cref="UpdateWebPage"/>, <see cref="UpdateReadMessagesContents"/>, <see cref="UpdateChannelTooLong"/>, <see cref="UpdateChannel"/>, <see cref="UpdateNewChannelMessage"/>, <see cref="UpdateReadChannelInbox"/>, <see cref="UpdateDeleteChannelMessages"/>, <see cref="UpdateChannelMessageViews"/>, <see cref="UpdateChatParticipantAdmin"/>, <see cref="UpdateNewStickerSet"/>, <see cref="UpdateStickerSetsOrder"/>, <see cref="UpdateStickerSets"/>, <see cref="UpdateSavedGifs"/>, <see cref="UpdateBotInlineQuery"/>, <see cref="UpdateBotInlineSend"/>, <see cref="UpdateEditChannelMessage"/>, <see cref="UpdateBotCallbackQuery"/>, <see cref="UpdateEditMessage"/>, <see cref="UpdateInlineBotCallbackQuery"/>, <see cref="UpdateReadChannelOutbox"/>, <see cref="UpdateDraftMessage"/>, <see cref="UpdateReadFeaturedStickers"/>, <see cref="UpdateRecentStickers"/>, <see cref="UpdateConfig"/>, <see cref="UpdatePtsChanged"/>, <see cref="UpdateChannelWebPage"/>, <see cref="UpdateDialogPinned"/>, <see cref="UpdatePinnedDialogs"/>, <see cref="UpdateBotWebhookJSON"/>, <see cref="UpdateBotWebhookJSONQuery"/>, <see cref="UpdateBotShippingQuery"/>, <see cref="UpdateBotPrecheckoutQuery"/>, <see cref="UpdatePhoneCall"/>, <see cref="UpdateLangPackTooLong"/>, <see cref="UpdateLangPack"/>, <see cref="UpdateFavedStickers"/>, <see cref="UpdateChannelReadMessagesContents"/>, <see cref="UpdateContactsReset"/>, <see cref="UpdateChannelAvailableMessages"/>, <see cref="UpdateDialogUnreadMark"/>, <see cref="UpdateMessagePoll"/>, <see cref="UpdateChatDefaultBannedRights"/>, <see cref="UpdateFolderPeers"/>, <see cref="UpdatePeerSettings"/>, <see cref="UpdatePeerLocated"/>, <see cref="UpdateNewScheduledMessage"/>, <see cref="UpdateDeleteScheduledMessages"/>, <see cref="UpdateTheme"/>, <see cref="UpdateGeoLiveViewed"/>, <see cref="UpdateLoginToken"/>, <see cref="UpdateMessagePollVote"/>, <see cref="UpdateDialogFilter"/>, <see cref="UpdateDialogFilterOrder"/>, <see cref="UpdateDialogFilters"/>, <see cref="UpdatePhoneCallSignalingData"/>, <see cref="UpdateChannelMessageForwards"/>, <see cref="UpdateReadChannelDiscussionInbox"/>, <see cref="UpdateReadChannelDiscussionOutbox"/>, <see cref="UpdatePeerBlocked"/>, <see cref="UpdateChannelUserTyping"/>, <see cref="UpdatePinnedMessages"/>, <see cref="UpdatePinnedChannelMessages"/>, <see cref="UpdateChat"/>, <see cref="UpdateGroupCallParticipants"/>, <see cref="UpdateGroupCall"/>, <see cref="UpdatePeerHistoryTTL"/>, <see cref="UpdateChatParticipant"/>, <see cref="UpdateChannelParticipant"/>, <see cref="UpdateBotStopped"/>, <see cref="UpdateGroupCallConnection"/>, <see cref="UpdateBotCommands"/>, <see cref="UpdatePendingJoinRequests"/>, <see cref="UpdateBotChatInviteRequester"/>, <see cref="UpdateMessageReactions"/>, <see cref="UpdateAttachMenuBots"/>, <see cref="UpdateWebViewResultSent"/>, <see cref="UpdateBotMenuButton"/>, <see cref="UpdateSavedRingtones"/>, <see cref="UpdateTranscribedAudio"/>, <see cref="UpdateReadFeaturedEmojiStickers"/>, <see cref="UpdateUserEmojiStatus"/>, <see cref="UpdateRecentEmojiStatuses"/>, <see cref="UpdateRecentReactions"/>, <see cref="UpdateMoveStickerSetToTop"/></para> <para>See <a href="https://corefork.telegram.org/type/Update"/></para></summary>
public abstract class Update : IObject { } public abstract class Update : IObject { }
/// <summary>New message in a private chat or in a <a href="https://core.telegram.org/api/channel#basic-groups">basic group</a>. <para>See <a href="https://corefork.telegram.org/constructor/updateNewMessage"/></para></summary> /// <summary>New message in a private chat or in a <a href="https://core.telegram.org/api/channel#basic-groups">basic group</a>. <para>See <a href="https://corefork.telegram.org/constructor/updateNewMessage"/></para></summary>
[TLDef(0x1F2B0AFD)] [TLDef(0x1F2B0AFD)]
@ -3434,15 +3435,18 @@ namespace TL
/// <summary>New sticker order by sticker ID</summary> /// <summary>New sticker order by sticker ID</summary>
public long[] order; public long[] order;
} }
/// <summary>Installed stickersets have changed, the client should refetch them using <a href="https://core.telegram.org/method/messages.getAllStickers">messages.getAllStickers</a> <para>See <a href="https://corefork.telegram.org/constructor/updateStickerSets"/></para></summary> /// <summary>Installed stickersets have changed, the client should refetch them as <a href="https://corefork.telegram.org/api/stickers#installing-stickersets">described in the docs</a>. <para>See <a href="https://corefork.telegram.org/constructor/updateStickerSets"/></para></summary>
[TLDef(0x31C24808)] [TLDef(0x31C24808)]
public class UpdateStickerSets : Update public class UpdateStickerSets : Update
{ {
/// <summary>Flags, see <a href="https://corefork.telegram.org/mtproto/TL-combinators#conditional-fields">TL conditional fields</a></summary>
public Flags flags; public Flags flags;
[Flags] public enum Flags : uint [Flags] public enum Flags : uint
{ {
/// <summary>Whether mask stickersets have changed</summary>
masks = 0x1, masks = 0x1,
/// <summary>Whether the list of installed <a href="https://corefork.telegram.org/api/custom-emoji">custom emoji stickersets</a> has changed</summary>
emojis = 0x2, emojis = 0x2,
} }
} }
@ -4252,23 +4256,26 @@ namespace TL
/// <summary>Some featured <a href="https://corefork.telegram.org/api/custom-emoji">custom emoji stickers</a> were marked as read <para>See <a href="https://corefork.telegram.org/constructor/updateReadFeaturedEmojiStickers"/></para></summary> /// <summary>Some featured <a href="https://corefork.telegram.org/api/custom-emoji">custom emoji stickers</a> were marked as read <para>See <a href="https://corefork.telegram.org/constructor/updateReadFeaturedEmojiStickers"/></para></summary>
[TLDef(0xFB4C496C)] [TLDef(0xFB4C496C)]
public class UpdateReadFeaturedEmojiStickers : Update { } public class UpdateReadFeaturedEmojiStickers : Update { }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/updateUserEmojiStatus"/></para></summary> /// <summary>The <a href="https://corefork.telegram.org/api/emoji-status">emoji status</a> of a certain user has changed <para>See <a href="https://corefork.telegram.org/constructor/updateUserEmojiStatus"/></para></summary>
[TLDef(0x28373599)] [TLDef(0x28373599)]
public class UpdateUserEmojiStatus : Update public class UpdateUserEmojiStatus : Update
{ {
/// <summary>User ID</summary>
public long user_id; public long user_id;
/// <summary>New <a href="https://corefork.telegram.org/api/emoji-status">emoji status</a></summary>
public EmojiStatus emoji_status; public EmojiStatus emoji_status;
} }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/updateRecentEmojiStatuses"/></para></summary> /// <summary>The list of recent <a href="https://corefork.telegram.org/api/emoji-status">emoji statuses</a> has changed <para>See <a href="https://corefork.telegram.org/constructor/updateRecentEmojiStatuses"/></para></summary>
[TLDef(0x30F443DB)] [TLDef(0x30F443DB)]
public class UpdateRecentEmojiStatuses : Update { } public class UpdateRecentEmojiStatuses : Update { }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/updateRecentReactions"/></para></summary> /// <summary>The list of recent <a href="https://corefork.telegram.org/api/reactions">message reactions</a> has changed <para>See <a href="https://corefork.telegram.org/constructor/updateRecentReactions"/></para></summary>
[TLDef(0x6F7863F4)] [TLDef(0x6F7863F4)]
public class UpdateRecentReactions : Update { } public class UpdateRecentReactions : Update { }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/updateMoveStickerSetToTop"/></para></summary> /// <summary><para>See <a href="https://corefork.telegram.org/constructor/updateMoveStickerSetToTop"/></para></summary>
[TLDef(0x86FCCF85)] [TLDef(0x86FCCF85)]
public class UpdateMoveStickerSetToTop : Update public class UpdateMoveStickerSetToTop : Update
{ {
/// <summary>Flags, see <a href="https://corefork.telegram.org/mtproto/TL-combinators#conditional-fields">TL conditional fields</a></summary>
public Flags flags; public Flags flags;
public long stickerset; public long stickerset;
@ -4804,6 +4811,7 @@ namespace TL
[IfFlag(2)] public int lang_pack_version; [IfFlag(2)] public int lang_pack_version;
/// <summary>Basic language pack version</summary> /// <summary>Basic language pack version</summary>
[IfFlag(2)] public int base_lang_pack_version; [IfFlag(2)] public int base_lang_pack_version;
/// <summary>Default <a href="https://corefork.telegram.org/api/reactions">message reaction</a></summary>
[IfFlag(15)] public Reaction reactions_default; [IfFlag(15)] public Reaction reactions_default;
[Flags] public enum Flags : uint [Flags] public enum Flags : uint
@ -5880,6 +5888,7 @@ namespace TL
public byte[] secure_random; public byte[] secure_random;
/// <summary>The 2FA password will be automatically removed at this date, unless the user cancels the operation</summary> /// <summary>The 2FA password will be automatically removed at this date, unless the user cancels the operation</summary>
[IfFlag(5)] public DateTime pending_reset_date; [IfFlag(5)] public DateTime pending_reset_date;
/// <summary>A verified login email with the specified <a href="https://corefork.telegram.org/api/pattern">pattern</a> is configured</summary>
[IfFlag(6)] public string login_email_pattern; [IfFlag(6)] public string login_email_pattern;
[Flags] public enum Flags : uint [Flags] public enum Flags : uint
@ -6074,7 +6083,7 @@ namespace TL
public DateTime expires; public DateTime expires;
} }
/// <summary>Represents a stickerset <para>Derived classes: <see cref="InputStickerSetID"/>, <see cref="InputStickerSetShortName"/>, <see cref="InputStickerSetAnimatedEmoji"/>, <see cref="InputStickerSetDice"/>, <see cref="InputStickerSetAnimatedEmojiAnimations"/>, <see cref="InputStickerSetPremiumGifts"/></para> <para>See <a href="https://corefork.telegram.org/type/InputStickerSet"/></para></summary> /// <summary>Represents a stickerset <para>Derived classes: <see cref="InputStickerSetID"/>, <see cref="InputStickerSetShortName"/>, <see cref="InputStickerSetAnimatedEmoji"/>, <see cref="InputStickerSetDice"/>, <see cref="InputStickerSetAnimatedEmojiAnimations"/>, <see cref="InputStickerSetPremiumGifts"/>, <see cref="InputStickerSetEmojiGenericAnimations"/>, <see cref="InputStickerSetEmojiDefaultStatuses"/></para> <para>See <a href="https://corefork.telegram.org/type/InputStickerSet"/></para></summary>
/// <remarks>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/inputStickerSetEmpty">inputStickerSetEmpty</a></remarks> /// <remarks>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/inputStickerSetEmpty">inputStickerSetEmpty</a></remarks>
public abstract partial class InputStickerSet : IObject { } public abstract partial class InputStickerSet : IObject { }
/// <summary>Stickerset by ID <para>See <a href="https://corefork.telegram.org/constructor/inputStickerSetID"/></para></summary> /// <summary>Stickerset by ID <para>See <a href="https://corefork.telegram.org/constructor/inputStickerSetID"/></para></summary>
@ -6109,10 +6118,10 @@ namespace TL
/// <summary>Stickers to show when receiving a gifted Telegram Premium subscription <para>See <a href="https://corefork.telegram.org/constructor/inputStickerSetPremiumGifts"/></para></summary> /// <summary>Stickers to show when receiving a gifted Telegram Premium subscription <para>See <a href="https://corefork.telegram.org/constructor/inputStickerSetPremiumGifts"/></para></summary>
[TLDef(0xC88B3B02)] [TLDef(0xC88B3B02)]
public class InputStickerSetPremiumGifts : InputStickerSet { } public class InputStickerSetPremiumGifts : InputStickerSet { }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/inputStickerSetEmojiGenericAnimations"/></para></summary> /// <summary>Generic animation stickerset containing animations to play when <a href="https://corefork.telegram.org/api/reactions">reacting to messages using a normal emoji without a custom animation</a> <para>See <a href="https://corefork.telegram.org/constructor/inputStickerSetEmojiGenericAnimations"/></para></summary>
[TLDef(0x04C4D4CE)] [TLDef(0x04C4D4CE)]
public class InputStickerSetEmojiGenericAnimations : InputStickerSet { } public class InputStickerSetEmojiGenericAnimations : InputStickerSet { }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/inputStickerSetEmojiDefaultStatuses"/></para></summary> /// <summary>Default <a href="https://corefork.telegram.org/api/emoji-status">custom emoji status</a> stickerset <para>See <a href="https://corefork.telegram.org/constructor/inputStickerSetEmojiDefaultStatuses"/></para></summary>
[TLDef(0x29D0F5EE)] [TLDef(0x29D0F5EE)]
public class InputStickerSetEmojiDefaultStatuses : InputStickerSet { } public class InputStickerSetEmojiDefaultStatuses : InputStickerSet { }
@ -7611,7 +7620,7 @@ namespace TL
MissedCall = 0xD61AD6EE, MissedCall = 0xD61AD6EE,
} }
/// <summary>Type of the verification code that was sent <para>Derived classes: <see cref="Auth_SentCodeTypeApp"/>, <see cref="Auth_SentCodeTypeSms"/>, <see cref="Auth_SentCodeTypeCall"/>, <see cref="Auth_SentCodeTypeFlashCall"/>, <see cref="Auth_SentCodeTypeMissedCall"/></para> <para>See <a href="https://corefork.telegram.org/type/auth.SentCodeType"/></para></summary> /// <summary>Type of the verification code that was sent <para>Derived classes: <see cref="Auth_SentCodeTypeApp"/>, <see cref="Auth_SentCodeTypeSms"/>, <see cref="Auth_SentCodeTypeCall"/>, <see cref="Auth_SentCodeTypeFlashCall"/>, <see cref="Auth_SentCodeTypeMissedCall"/>, <see cref="Auth_SentCodeTypeEmailCode"/>, <see cref="Auth_SentCodeTypeSetUpEmailRequired"/></para> <para>See <a href="https://corefork.telegram.org/type/auth.SentCodeType"/></para></summary>
public abstract class Auth_SentCodeType : IObject { } public abstract class Auth_SentCodeType : IObject { }
/// <summary>The code was sent through the telegram app <para>See <a href="https://corefork.telegram.org/constructor/auth.sentCodeTypeApp"/></para></summary> /// <summary>The code was sent through the telegram app <para>See <a href="https://corefork.telegram.org/constructor/auth.sentCodeTypeApp"/></para></summary>
[TLDef(0x3DBB5986)] [TLDef(0x3DBB5986)]
@ -7648,31 +7657,41 @@ namespace TL
/// <summary>Prefix of the phone number from which the call will be made</summary> /// <summary>Prefix of the phone number from which the call will be made</summary>
public string prefix; public string prefix;
} }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/auth.sentCodeTypeEmailCode"/></para></summary> /// <summary>The code was sent via email <para>See <a href="https://corefork.telegram.org/constructor/auth.sentCodeTypeEmailCode"/></para></summary>
[TLDef(0x5A159841)] [TLDef(0x5A159841)]
public class Auth_SentCodeTypeEmailCode : Auth_SentCodeType public class Auth_SentCodeTypeEmailCode : Auth_SentCodeType
{ {
/// <summary>Flags, see <a href="https://corefork.telegram.org/mtproto/TL-combinators#conditional-fields">TL conditional fields</a></summary>
public Flags flags; public Flags flags;
/// <summary><a href="https://corefork.telegram.org/api/pattern">Pattern</a> of the email</summary>
public string email_pattern; public string email_pattern;
/// <summary>Length of the sent verification code</summary>
public int length; public int length;
/// <summary>If set, contains an absolute UNIX timestamp indicating when will the user be able to authorize with a code sent to the user's phone number</summary>
[IfFlag(2)] public DateTime next_phone_login_date; [IfFlag(2)] public DateTime next_phone_login_date;
[Flags] public enum Flags : uint [Flags] public enum Flags : uint
{ {
/// <summary>Whether authorization through Apple ID is allowed</summary>
apple_signin_allowed = 0x1, apple_signin_allowed = 0x1,
/// <summary>Whether authorization through Google ID is allowed</summary>
google_signin_allowed = 0x2, google_signin_allowed = 0x2,
/// <summary>Field <see cref="next_phone_login_date"/> has a value</summary>
has_next_phone_login_date = 0x4, has_next_phone_login_date = 0x4,
} }
} }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/auth.sentCodeTypeSetUpEmailRequired"/></para></summary> /// <summary>The user should add and verify an email address in order to login <para>See <a href="https://corefork.telegram.org/constructor/auth.sentCodeTypeSetUpEmailRequired"/></para></summary>
[TLDef(0xA5491DEA)] [TLDef(0xA5491DEA)]
public class Auth_SentCodeTypeSetUpEmailRequired : Auth_SentCodeType public class Auth_SentCodeTypeSetUpEmailRequired : Auth_SentCodeType
{ {
/// <summary>Flags, see <a href="https://corefork.telegram.org/mtproto/TL-combinators#conditional-fields">TL conditional fields</a></summary>
public Flags flags; public Flags flags;
[Flags] public enum Flags : uint [Flags] public enum Flags : uint
{ {
/// <summary>Whether authorization through Apple ID is allowed</summary>
apple_signin_allowed = 0x1, apple_signin_allowed = 0x1,
/// <summary>Whether authorization through Google ID is allowed</summary>
google_signin_allowed = 0x2, google_signin_allowed = 0x2,
} }
} }
@ -13365,6 +13384,7 @@ namespace TL
public string[] video_sections; public string[] video_sections;
/// <summary>A list of videos</summary> /// <summary>A list of videos</summary>
public DocumentBase[] videos; public DocumentBase[] videos;
/// <summary>Telegram Premium subscription options</summary>
public PremiumSubscriptionOption[] period_options; public PremiumSubscriptionOption[] period_options;
/// <summary>Related user information</summary> /// <summary>Related user information</summary>
public Dictionary<long, User> users; public Dictionary<long, User> users;
@ -13431,155 +13451,181 @@ namespace TL
public string title; public string title;
} }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/emojiStatus"/></para></summary> /// <summary>An <a href="https://corefork.telegram.org/api/emoji-status">emoji status</a> <para>See <a href="https://corefork.telegram.org/constructor/emojiStatus"/></para></summary>
/// <remarks>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/emojiStatusEmpty">emojiStatusEmpty</a></remarks> /// <remarks>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/emojiStatusEmpty">emojiStatusEmpty</a></remarks>
[TLDef(0x929B619D)] [TLDef(0x929B619D)]
public class EmojiStatus : IObject public class EmojiStatus : IObject
{ {
/// <summary><a href="https://corefork.telegram.org/api/custom-emoji">Custom emoji document ID</a></summary>
public long document_id; public long document_id;
} }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/emojiStatusUntil"/></para></summary> /// <summary>An <a href="https://corefork.telegram.org/api/emoji-status">emoji status</a> valid until the specified date <para>See <a href="https://corefork.telegram.org/constructor/emojiStatusUntil"/></para></summary>
[TLDef(0xFA30A8C7, inheritBefore = true)] [TLDef(0xFA30A8C7, inheritBefore = true)]
public class EmojiStatusUntil : EmojiStatus public class EmojiStatusUntil : EmojiStatus
{ {
/// <summary>This status is valid until this date</summary>
public int until; public int until;
} }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/account.emojiStatuses"/></para></summary> /// <summary>A list of <a href="https://corefork.telegram.org/api/emoji-status">emoji statuses</a> <para>See <a href="https://corefork.telegram.org/constructor/account.emojiStatuses"/></para></summary>
/// <remarks>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/account.emojiStatusesNotModified">account.emojiStatusesNotModified</a></remarks> /// <remarks>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/account.emojiStatusesNotModified">account.emojiStatusesNotModified</a></remarks>
[TLDef(0x90C467D1)] [TLDef(0x90C467D1)]
public class Account_EmojiStatuses : IObject public class Account_EmojiStatuses : IObject
{ {
/// <summary><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></summary>
public long hash; public long hash;
/// <summary><a href="https://corefork.telegram.org/api/emoji-status">Emoji statuses</a></summary>
public EmojiStatus[] statuses; public EmojiStatus[] statuses;
} }
/// <summary><para>See <a href="https://corefork.telegram.org/type/Reaction"/></para></summary> /// <summary><a href="https://corefork.telegram.org/api/reactions">Message reaction</a> <para>Derived classes: <see cref="ReactionEmoji"/>, <see cref="ReactionCustomEmoji"/></para> <para>See <a href="https://corefork.telegram.org/type/Reaction"/></para></summary>
/// <remarks>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/reactionEmpty">reactionEmpty</a></remarks> /// <remarks>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/reactionEmpty">reactionEmpty</a></remarks>
public abstract class Reaction : IObject { } public abstract class Reaction : IObject { }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/reactionEmoji"/></para></summary> /// <summary>Normal emoji message reaction <para>See <a href="https://corefork.telegram.org/constructor/reactionEmoji"/></para></summary>
[TLDef(0x1B2286B8)] [TLDef(0x1B2286B8)]
public class ReactionEmoji : Reaction public class ReactionEmoji : Reaction
{ {
/// <summary>Emoji</summary>
public string emoticon; public string emoticon;
} }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/reactionCustomEmoji"/></para></summary> /// <summary><a href="https://corefork.telegram.org/api/custom-emoji">Custom emoji</a> message reaction <para>See <a href="https://corefork.telegram.org/constructor/reactionCustomEmoji"/></para></summary>
[TLDef(0x8935FC73)] [TLDef(0x8935FC73)]
public class ReactionCustomEmoji : Reaction public class ReactionCustomEmoji : Reaction
{ {
/// <summary><a href="https://corefork.telegram.org/api/custom-emoji">Custom emoji document ID</a></summary>
public long document_id; public long document_id;
} }
/// <summary><para>See <a href="https://corefork.telegram.org/type/ChatReactions"/></para></summary> /// <summary>Available chat reactions <para>Derived classes: <see cref="ChatReactionsNone"/>, <see cref="ChatReactionsAll"/>, <see cref="ChatReactionsSome"/></para> <para>See <a href="https://corefork.telegram.org/type/ChatReactions"/></para></summary>
public abstract class ChatReactions : IObject { } public abstract class ChatReactions : IObject { }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/chatReactionsNone"/></para></summary> /// <summary>No reactions are allowed <para>See <a href="https://corefork.telegram.org/constructor/chatReactionsNone"/></para></summary>
[TLDef(0xEAFC32BC)] [TLDef(0xEAFC32BC)]
public class ChatReactionsNone : ChatReactions { } public class ChatReactionsNone : ChatReactions { }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/chatReactionsAll"/></para></summary> /// <summary>All reactions or all non-custom reactions are allowed <para>See <a href="https://corefork.telegram.org/constructor/chatReactionsAll"/></para></summary>
[TLDef(0x52928BCA)] [TLDef(0x52928BCA)]
public class ChatReactionsAll : ChatReactions public class ChatReactionsAll : ChatReactions
{ {
/// <summary>Flags, see <a href="https://corefork.telegram.org/mtproto/TL-combinators#conditional-fields">TL conditional fields</a></summary>
public Flags flags; public Flags flags;
[Flags] public enum Flags : uint [Flags] public enum Flags : uint
{ {
/// <summary>Whether to allow custom reactions</summary>
allow_custom = 0x1, allow_custom = 0x1,
} }
} }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/chatReactionsSome"/></para></summary> /// <summary>Some reactions are allowed <para>See <a href="https://corefork.telegram.org/constructor/chatReactionsSome"/></para></summary>
[TLDef(0x661D4037)] [TLDef(0x661D4037)]
public class ChatReactionsSome : ChatReactions public class ChatReactionsSome : ChatReactions
{ {
/// <summary>Allowed reactions</summary>
public Reaction[] reactions; public Reaction[] reactions;
} }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/messages.reactions"/></para></summary> /// <summary>List of <a href="https://corefork.telegram.org/api/reactions">message reactions</a> <para>See <a href="https://corefork.telegram.org/constructor/messages.reactions"/></para></summary>
/// <remarks>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/messages.reactionsNotModified">messages.reactionsNotModified</a></remarks> /// <remarks>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/messages.reactionsNotModified">messages.reactionsNotModified</a></remarks>
[TLDef(0xEAFDF716)] [TLDef(0xEAFDF716)]
public class Messages_Reactions : IObject public class Messages_Reactions : IObject
{ {
/// <summary><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></summary>
public long hash; public long hash;
/// <summary>Reactions</summary>
public Reaction[] reactions; public Reaction[] reactions;
} }
/// <summary><para>See <a href="https://corefork.telegram.org/type/EmailVerifyPurpose"/></para></summary> /// <summary>Email verification purpose <para>Derived classes: <see cref="EmailVerifyPurposeLoginSetup"/>, <see cref="EmailVerifyPurposeLoginChange"/>, <see cref="EmailVerifyPurposePassport"/></para> <para>See <a href="https://corefork.telegram.org/type/EmailVerifyPurpose"/></para></summary>
public abstract class EmailVerifyPurpose : IObject { } public abstract class EmailVerifyPurpose : IObject { }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/emailVerifyPurposeLoginSetup"/></para></summary> /// <summary>Email verification purpose: setup login email <para>See <a href="https://corefork.telegram.org/constructor/emailVerifyPurposeLoginSetup"/></para></summary>
[TLDef(0x4345BE73)] [TLDef(0x4345BE73)]
public class EmailVerifyPurposeLoginSetup : EmailVerifyPurpose public class EmailVerifyPurposeLoginSetup : EmailVerifyPurpose
{ {
public string phone_number; public string phone_number;
public string phone_code_hash; public string phone_code_hash;
} }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/emailVerifyPurposeLoginChange"/></para></summary> /// <summary>Email verification purpose: change login email <para>See <a href="https://corefork.telegram.org/constructor/emailVerifyPurposeLoginChange"/></para></summary>
[TLDef(0x527D22EB)] [TLDef(0x527D22EB)]
public class EmailVerifyPurposeLoginChange : EmailVerifyPurpose { } public class EmailVerifyPurposeLoginChange : EmailVerifyPurpose { }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/emailVerifyPurposePassport"/></para></summary> /// <summary>Verify an email for use in <a href="https://corefork.telegram.org/api/passport">telegram passport</a> <para>See <a href="https://corefork.telegram.org/constructor/emailVerifyPurposePassport"/></para></summary>
[TLDef(0xBBF51685)] [TLDef(0xBBF51685)]
public class EmailVerifyPurposePassport : EmailVerifyPurpose { } public class EmailVerifyPurposePassport : EmailVerifyPurpose { }
/// <summary><para>See <a href="https://corefork.telegram.org/type/EmailVerification"/></para></summary> /// <summary>Email verification code or token <para>Derived classes: <see cref="EmailVerificationCode"/>, <see cref="EmailVerificationGoogle"/>, <see cref="EmailVerificationApple"/></para> <para>See <a href="https://corefork.telegram.org/type/EmailVerification"/></para></summary>
public abstract class EmailVerification : IObject { } public abstract class EmailVerification : IObject { }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/emailVerificationCode"/></para></summary> /// <summary>Email verification code <para>See <a href="https://corefork.telegram.org/constructor/emailVerificationCode"/></para></summary>
[TLDef(0x922E55A9)] [TLDef(0x922E55A9)]
public class EmailVerificationCode : EmailVerification public class EmailVerificationCode : EmailVerification
{ {
/// <summary>Received verification code</summary>
public string code; public string code;
} }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/emailVerificationGoogle"/></para></summary> /// <summary>Google ID email verification token <para>See <a href="https://corefork.telegram.org/constructor/emailVerificationGoogle"/></para></summary>
[TLDef(0xDB909EC2)] [TLDef(0xDB909EC2)]
public class EmailVerificationGoogle : EmailVerification public class EmailVerificationGoogle : EmailVerification
{ {
/// <summary>Token</summary>
public string token; public string token;
} }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/emailVerificationApple"/></para></summary> /// <summary>Apple ID email verification token <para>See <a href="https://corefork.telegram.org/constructor/emailVerificationApple"/></para></summary>
[TLDef(0x96D074FD)] [TLDef(0x96D074FD)]
public class EmailVerificationApple : EmailVerification public class EmailVerificationApple : EmailVerification
{ {
/// <summary>Token</summary>
public string token; public string token;
} }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/account.emailVerified"/></para></summary> /// <summary>The email was verified correctly. <para>See <a href="https://corefork.telegram.org/constructor/account.emailVerified"/></para></summary>
[TLDef(0x2B96CD1B)] [TLDef(0x2B96CD1B)]
public class Account_EmailVerified : IObject public class Account_EmailVerified : IObject
{ {
/// <summary>The verified email address.</summary>
public string email; public string email;
} }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/account.emailVerifiedLogin"/></para></summary> /// <summary>The email was verified correctly, and a login code was just sent to it. <para>See <a href="https://corefork.telegram.org/constructor/account.emailVerifiedLogin"/></para></summary>
[TLDef(0xE1BB0D61, inheritBefore = true)] [TLDef(0xE1BB0D61, inheritBefore = true)]
public class Account_EmailVerifiedLogin : Account_EmailVerified public class Account_EmailVerifiedLogin : Account_EmailVerified
{ {
/// <summary>Info about the sent <a href="https://corefork.telegram.org/api/auth">login code</a></summary>
public Auth_SentCode sent_code; public Auth_SentCode sent_code;
} }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/premiumSubscriptionOption"/></para></summary> /// <summary>Describes a Telegram Premium subscription option <para>See <a href="https://corefork.telegram.org/constructor/premiumSubscriptionOption"/></para></summary>
[TLDef(0xB6F11EBE)] [TLDef(0xB6F11EBE)]
public class PremiumSubscriptionOption : IObject public class PremiumSubscriptionOption : IObject
{ {
/// <summary>Flags, see <a href="https://corefork.telegram.org/mtproto/TL-combinators#conditional-fields">TL conditional fields</a></summary>
public Flags flags; public Flags flags;
/// <summary>Duration of subscription in months</summary>
public int months; public int months;
/// <summary>Three-letter ISO 4217 <a href="https://corefork.telegram.org/bots/payments#supported-currencies">currency</a> code</summary>
public string currency; public string currency;
/// <summary>Total price in the smallest units of the currency (integer, not float/double). For example, for a price of <c>US$ 1.45</c> pass <c>amount = 145</c>. See the exp parameter in <a href="https://corefork.telegram.org/bots/payments/currencies.json">currencies.json</a>, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).</summary>
public long amount; public long amount;
/// <summary><a href="https://corefork.telegram.org/api/links">Deep link</a> used to initiate payment</summary>
public string bot_url; public string bot_url;
/// <summary>Store product ID, only for official apps</summary>
[IfFlag(0)] public string store_product; [IfFlag(0)] public string store_product;
[Flags] public enum Flags : uint [Flags] public enum Flags : uint
{ {
/// <summary>Field <see cref="store_product"/> has a value</summary>
has_store_product = 0x1, has_store_product = 0x1,
current = 0x2, current = 0x2,
can_purchase_upgrade = 0x4, can_purchase_upgrade = 0x4,
} }
} }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/sendAsPeer"/></para></summary> /// <summary>Indicates a peer that can be used to send messages <para>See <a href="https://corefork.telegram.org/constructor/sendAsPeer"/></para></summary>
[TLDef(0xB81C7034)] [TLDef(0xB81C7034)]
public class SendAsPeer : IObject public class SendAsPeer : IObject
{ {
/// <summary>Flags, see <a href="https://corefork.telegram.org/mtproto/TL-combinators#conditional-fields">TL conditional fields</a></summary>
public Flags flags; public Flags flags;
/// <summary>Peer</summary>
public Peer peer; public Peer peer;
[Flags] public enum Flags : uint [Flags] public enum Flags : uint
{ {
/// <summary>Whether a Telegram Premium account is required to send messages as this peer</summary>
premium_required = 0x1, premium_required = 0x1,
} }
} }

View file

@ -126,6 +126,7 @@ namespace TL
/// <param name="phone_number">Phone number in the international format</param> /// <param name="phone_number">Phone number in the international format</param>
/// <param name="phone_code_hash">SMS-message ID, obtained from <a href="https://corefork.telegram.org/method/auth.sendCode">auth.sendCode</a></param> /// <param name="phone_code_hash">SMS-message ID, obtained from <a href="https://corefork.telegram.org/method/auth.sendCode">auth.sendCode</a></param>
/// <param name="phone_code">Valid numerical code from the SMS-message</param> /// <param name="phone_code">Valid numerical code from the SMS-message</param>
/// <param name="email_verification">Email verification code or token</param>
[Obsolete("Use LoginUserIfNeeded instead of this method. See https://github.com/wiz0u/WTelegramClient/blob/master/FAQ.md#tlsharp")] [Obsolete("Use LoginUserIfNeeded instead of this method. See https://github.com/wiz0u/WTelegramClient/blob/master/FAQ.md#tlsharp")]
public static Task<Auth_AuthorizationBase> Auth_SignIn(this Client client, string phone_number, string phone_code_hash, string phone_code = null, EmailVerification email_verification = null) public static Task<Auth_AuthorizationBase> Auth_SignIn(this Client client, string phone_number, string phone_code_hash, string phone_code = null, EmailVerification email_verification = null)
=> client.Invoke(new Auth_SignIn => client.Invoke(new Auth_SignIn
@ -640,8 +641,9 @@ namespace TL
phone_code = phone_code, phone_code = phone_code,
}); });
/// <summary>Send the verification email code for telegram <a href="https://corefork.telegram.org/passport">passport</a>. <para>See <a href="https://corefork.telegram.org/method/account.sendVerifyEmailCode"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/account.sendVerifyEmailCode#possible-errors">details</a>)</para></summary> /// <summary>Send an email verification code. <para>See <a href="https://corefork.telegram.org/method/account.sendVerifyEmailCode"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/account.sendVerifyEmailCode#possible-errors">details</a>)</para></summary>
/// <param name="email">The email where to send the code</param> /// <param name="purpose">Verification purpose.</param>
/// <param name="email">The email where to send the code.</param>
public static Task<Account_SentEmailCode> Account_SendVerifyEmailCode(this Client client, EmailVerifyPurpose purpose, string email) public static Task<Account_SentEmailCode> Account_SendVerifyEmailCode(this Client client, EmailVerifyPurpose purpose, string email)
=> client.Invoke(new Account_SendVerifyEmailCode => client.Invoke(new Account_SendVerifyEmailCode
{ {
@ -649,7 +651,9 @@ namespace TL
email = email, email = email,
}); });
/// <summary>Verify an email address for telegram <a href="https://corefork.telegram.org/passport">passport</a>. <para>See <a href="https://corefork.telegram.org/method/account.verifyEmail"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/account.verifyEmail#possible-errors">details</a>)</para></summary> /// <summary>Verify an email address. <para>See <a href="https://corefork.telegram.org/method/account.verifyEmail"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/account.verifyEmail#possible-errors">details</a>)</para></summary>
/// <param name="purpose">Verification purpose</param>
/// <param name="verification">Email verification code or token</param>
public static Task<Account_EmailVerified> Account_VerifyEmail(this Client client, EmailVerifyPurpose purpose, EmailVerification verification) public static Task<Account_EmailVerified> Account_VerifyEmail(this Client client, EmailVerifyPurpose purpose, EmailVerification verification)
=> client.Invoke(new Account_VerifyEmail => client.Invoke(new Account_VerifyEmail
{ {
@ -1008,14 +1012,16 @@ namespace TL
mime_type = mime_type, mime_type = mime_type,
}); });
/// <summary><para>See <a href="https://corefork.telegram.org/method/account.updateEmojiStatus"/></para></summary> /// <summary>Set an <a href="https://corefork.telegram.org/api/emoji-status">emoji status</a> <para>See <a href="https://corefork.telegram.org/method/account.updateEmojiStatus"/></para></summary>
/// <param name="emoji_status"><a href="https://corefork.telegram.org/api/emoji-status">Emoji status</a> to set</param>
public static Task<bool> Account_UpdateEmojiStatus(this Client client, EmojiStatus emoji_status) public static Task<bool> Account_UpdateEmojiStatus(this Client client, EmojiStatus emoji_status)
=> client.Invoke(new Account_UpdateEmojiStatus => client.Invoke(new Account_UpdateEmojiStatus
{ {
emoji_status = emoji_status, emoji_status = emoji_status,
}); });
/// <summary><para>See <a href="https://corefork.telegram.org/method/account.getDefaultEmojiStatuses"/></para></summary> /// <summary>Get a list of default suggested <a href="https://corefork.telegram.org/api/emoji-status">emoji statuses</a> <para>See <a href="https://corefork.telegram.org/method/account.getDefaultEmojiStatuses"/></para></summary>
/// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param>
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/account.emojiStatusesNotModified">account.emojiStatusesNotModified</a></returns> /// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/account.emojiStatusesNotModified">account.emojiStatusesNotModified</a></returns>
public static Task<Account_EmojiStatuses> Account_GetDefaultEmojiStatuses(this Client client, long hash = default) public static Task<Account_EmojiStatuses> Account_GetDefaultEmojiStatuses(this Client client, long hash = default)
=> client.Invoke(new Account_GetDefaultEmojiStatuses => client.Invoke(new Account_GetDefaultEmojiStatuses
@ -1023,7 +1029,8 @@ namespace TL
hash = hash, hash = hash,
}); });
/// <summary><para>See <a href="https://corefork.telegram.org/method/account.getRecentEmojiStatuses"/></para></summary> /// <summary>Get recently used <a href="https://corefork.telegram.org/api/emoji-status">emoji statuses</a> <para>See <a href="https://corefork.telegram.org/method/account.getRecentEmojiStatuses"/></para></summary>
/// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param>
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/account.emojiStatusesNotModified">account.emojiStatusesNotModified</a></returns> /// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/account.emojiStatusesNotModified">account.emojiStatusesNotModified</a></returns>
public static Task<Account_EmojiStatuses> Account_GetRecentEmojiStatuses(this Client client, long hash = default) public static Task<Account_EmojiStatuses> Account_GetRecentEmojiStatuses(this Client client, long hash = default)
=> client.Invoke(new Account_GetRecentEmojiStatuses => client.Invoke(new Account_GetRecentEmojiStatuses
@ -1031,7 +1038,7 @@ namespace TL
hash = hash, hash = hash,
}); });
/// <summary><para>See <a href="https://corefork.telegram.org/method/account.clearRecentEmojiStatuses"/></para></summary> /// <summary>Clears list of recently used <a href="https://corefork.telegram.org/api/emoji-status">emoji statuses</a> <para>See <a href="https://corefork.telegram.org/method/account.clearRecentEmojiStatuses"/></para></summary>
public static Task<bool> Account_ClearRecentEmojiStatuses(this Client client) public static Task<bool> Account_ClearRecentEmojiStatuses(this Client client)
=> client.Invoke(new Account_ClearRecentEmojiStatuses => client.Invoke(new Account_ClearRecentEmojiStatuses
{ {
@ -3046,6 +3053,7 @@ namespace TL
/// <summary>React to message <para>See <a href="https://corefork.telegram.org/method/messages.sendReaction"/></para> <para>Possible <see cref="RpcException"/> codes: 400,403 (<a href="https://corefork.telegram.org/method/messages.sendReaction#possible-errors">details</a>)</para></summary> /// <summary>React to message <para>See <a href="https://corefork.telegram.org/method/messages.sendReaction"/></para> <para>Possible <see cref="RpcException"/> codes: 400,403 (<a href="https://corefork.telegram.org/method/messages.sendReaction#possible-errors">details</a>)</para></summary>
/// <param name="big">Whether a bigger and longer reaction should be shown</param> /// <param name="big">Whether a bigger and longer reaction should be shown</param>
/// <param name="add_to_recent">Add this reaction to the recent reactions list</param>
/// <param name="peer">Peer</param> /// <param name="peer">Peer</param>
/// <param name="msg_id">Message ID to react to</param> /// <param name="msg_id">Message ID to react to</param>
/// <param name="reaction">Reaction (a UTF8 emoji)</param> /// <param name="reaction">Reaction (a UTF8 emoji)</param>
@ -3202,6 +3210,7 @@ namespace TL
/// <param name="url"><a href="https://corefork.telegram.org/api/bots/webapps">Web app URL</a></param> /// <param name="url"><a href="https://corefork.telegram.org/api/bots/webapps">Web app URL</a></param>
/// <param name="start_param">If the web app was opened from the attachment menu using a <a href="https://corefork.telegram.org/api/links#bot-attachment-menu-links">attachment menu deep link</a>, <c>start_param</c> should contain the <c>data</c> from the <c>startattach</c> parameter.</param> /// <param name="start_param">If the web app was opened from the attachment menu using a <a href="https://corefork.telegram.org/api/links#bot-attachment-menu-links">attachment menu deep link</a>, <c>start_param</c> should contain the <c>data</c> from the <c>startattach</c> parameter.</param>
/// <param name="theme_params">Theme parameters for the web app</param> /// <param name="theme_params">Theme parameters for the web app</param>
/// <param name="platform">Short name of the application; 0-64 English letters, digits, and underscores</param>
/// <param name="reply_to_msg_id">Whether the inline message that will be sent by the bot on behalf of the user once the web app interaction is <a href="https://corefork.telegram.org/method/messages.sendWebViewResultMessage">terminated</a> should be sent in reply to this message ID.</param> /// <param name="reply_to_msg_id">Whether the inline message that will be sent by the bot on behalf of the user once the web app interaction is <a href="https://corefork.telegram.org/method/messages.sendWebViewResultMessage">terminated</a> should be sent in reply to this message ID.</param>
/// <param name="send_as">Open the web app as the specified peer, sending the resulting the message as the specified peer.</param> /// <param name="send_as">Open the web app as the specified peer, sending the resulting the message as the specified peer.</param>
public static Task<WebViewResult> Messages_RequestWebView(this Client client, InputPeer peer, InputUserBase bot, string platform, bool from_bot_menu = false, bool silent = false, string url = null, string start_param = null, DataJSON theme_params = null, int? reply_to_msg_id = null, InputPeer send_as = null) public static Task<WebViewResult> Messages_RequestWebView(this Client client, InputPeer peer, InputUserBase bot, string platform, bool from_bot_menu = false, bool silent = false, string url = null, string start_param = null, DataJSON theme_params = null, int? reply_to_msg_id = null, InputPeer send_as = null)
@ -3240,6 +3249,7 @@ namespace TL
/// <param name="bot">Bot that owns the webapp</param> /// <param name="bot">Bot that owns the webapp</param>
/// <param name="url">Web app URL</param> /// <param name="url">Web app URL</param>
/// <param name="theme_params">Theme parameters</param> /// <param name="theme_params">Theme parameters</param>
/// <param name="platform">Short name of the application; 0-64 English letters, digits, and underscores</param>
public static Task<SimpleWebViewResult> Messages_RequestSimpleWebView(this Client client, InputUserBase bot, string url, string platform, DataJSON theme_params = null) public static Task<SimpleWebViewResult> Messages_RequestSimpleWebView(this Client client, InputUserBase bot, string url, string platform, DataJSON theme_params = null)
=> client.Invoke(new Messages_RequestSimpleWebView => client.Invoke(new Messages_RequestSimpleWebView
{ {
@ -3323,7 +3333,10 @@ namespace TL
hash = hash, hash = hash,
}); });
/// <summary><para>See <a href="https://corefork.telegram.org/method/messages.reportReaction"/></para></summary> /// <summary>Report a <a href="https://corefork.telegram.org/api/reactions">message reaction</a> <para>See <a href="https://corefork.telegram.org/method/messages.reportReaction"/></para></summary>
/// <param name="peer">Peer where the message was sent</param>
/// <param name="id">Message ID</param>
/// <param name="reaction_peer">Peer that sent the reaction</param>
public static Task<bool> Messages_ReportReaction(this Client client, InputPeer peer, int id, InputPeer reaction_peer) public static Task<bool> Messages_ReportReaction(this Client client, InputPeer peer, int id, InputPeer reaction_peer)
=> client.Invoke(new Messages_ReportReaction => client.Invoke(new Messages_ReportReaction
{ {
@ -3332,7 +3345,9 @@ namespace TL
reaction_peer = reaction_peer, reaction_peer = reaction_peer,
}); });
/// <summary><para>See <a href="https://corefork.telegram.org/method/messages.getTopReactions"/></para></summary> /// <summary>Got popular <a href="https://corefork.telegram.org/api/reactions">message reactions</a> <para>See <a href="https://corefork.telegram.org/method/messages.getTopReactions"/></para></summary>
/// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param>
/// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param>
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/messages.reactionsNotModified">messages.reactionsNotModified</a></returns> /// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/messages.reactionsNotModified">messages.reactionsNotModified</a></returns>
public static Task<Messages_Reactions> Messages_GetTopReactions(this Client client, int limit = int.MaxValue, long hash = default) public static Task<Messages_Reactions> Messages_GetTopReactions(this Client client, int limit = int.MaxValue, long hash = default)
=> client.Invoke(new Messages_GetTopReactions => client.Invoke(new Messages_GetTopReactions
@ -3341,7 +3356,9 @@ namespace TL
hash = hash, hash = hash,
}); });
/// <summary><para>See <a href="https://corefork.telegram.org/method/messages.getRecentReactions"/></para></summary> /// <summary>Get recently used <a href="https://corefork.telegram.org/api/reactions">message reactions</a> <para>See <a href="https://corefork.telegram.org/method/messages.getRecentReactions"/></para></summary>
/// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param>
/// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param>
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/messages.reactionsNotModified">messages.reactionsNotModified</a></returns> /// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/messages.reactionsNotModified">messages.reactionsNotModified</a></returns>
public static Task<Messages_Reactions> Messages_GetRecentReactions(this Client client, int limit = int.MaxValue, long hash = default) public static Task<Messages_Reactions> Messages_GetRecentReactions(this Client client, int limit = int.MaxValue, long hash = default)
=> client.Invoke(new Messages_GetRecentReactions => client.Invoke(new Messages_GetRecentReactions
@ -3350,7 +3367,7 @@ namespace TL
hash = hash, hash = hash,
}); });
/// <summary><para>See <a href="https://corefork.telegram.org/method/messages.clearRecentReactions"/></para></summary> /// <summary>Clear recently used <a href="https://corefork.telegram.org/api/reactions">message reactions</a> <para>See <a href="https://corefork.telegram.org/method/messages.clearRecentReactions"/></para></summary>
public static Task<bool> Messages_ClearRecentReactions(this Client client) public static Task<bool> Messages_ClearRecentReactions(this Client client)
=> client.Invoke(new Messages_ClearRecentReactions => client.Invoke(new Messages_ClearRecentReactions
{ {