mirror of
https://github.com/wiz0u/WTelegramClient.git
synced 2026-01-07 17:20:17 +01:00
API Layer 154: bot app/webview stuff, modifying stickers...
This commit is contained in:
parent
22ea4c6de8
commit
c646cac738
|
|
@ -301,7 +301,7 @@ await client.SendMediaAsync(InputPeer.Self, null, inputFile);
|
|||
|
||||
// • Send a random dice/game-of-chance effect from the list of available "dices", see https://core.telegram.org/api/dice
|
||||
var appConfig = await client.Help_GetAppConfig();
|
||||
var emojies_send_dice = appConfig["emojies_send_dice"] as string[];
|
||||
var emojies_send_dice = appConfig.config["emojies_send_dice"] as string[];
|
||||
var dice_emoji = emojies_send_dice[new Random().Next(emojies_send_dice.Length)];
|
||||
var diceMsg = await client.SendMessageAsync(InputPeer.Self, null, new InputMediaDice { emoticon = dice_emoji });
|
||||
Console.WriteLine("Dice result:" + ((MessageMediaDice)diceMsg.media).value);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
[](https://corefork.telegram.org/methods)
|
||||
[](https://corefork.telegram.org/methods)
|
||||
[](https://www.nuget.org/packages/WTelegramClient/)
|
||||
[](https://dev.azure.com/wiz0u/WTelegramClient/_build?definitionId=7)
|
||||
[](http://t.me/WTelegramBot?start=donate)
|
||||
|
|
|
|||
141
src/TL.Schema.cs
141
src/TL.Schema.cs
|
|
@ -2056,11 +2056,22 @@ namespace TL
|
|||
public string message;
|
||||
}
|
||||
/// <summary>The domain name of the website on which the user has logged in. <a href="https://corefork.telegram.org/widgets/login">More about Telegram Login »</a> <para>See <a href="https://corefork.telegram.org/constructor/messageActionBotAllowed"/></para></summary>
|
||||
[TLDef(0xABE9AFFE)]
|
||||
[TLDef(0xC516D679)]
|
||||
public class MessageActionBotAllowed : MessageAction
|
||||
{
|
||||
public Flags flags;
|
||||
/// <summary>The domain name of the website on which the user has logged in.</summary>
|
||||
public string domain;
|
||||
[IfFlag(0)] public string domain;
|
||||
[IfFlag(2)] public BotApp app;
|
||||
|
||||
[Flags] public enum Flags : uint
|
||||
{
|
||||
/// <summary>Field <see cref="domain"/> has a value</summary>
|
||||
has_domain = 0x1,
|
||||
attach_menu = 0x2,
|
||||
/// <summary>Field <see cref="app"/> has a value</summary>
|
||||
has_app = 0x4,
|
||||
}
|
||||
}
|
||||
/// <summary>Secure <a href="https://corefork.telegram.org/passport">telegram passport</a> values were received <para>See <a href="https://corefork.telegram.org/constructor/messageActionSecureValuesSentMe"/></para></summary>
|
||||
[TLDef(0x1B287353)]
|
||||
|
|
@ -2215,9 +2226,6 @@ namespace TL
|
|||
{
|
||||
public PhotoBase photo;
|
||||
}
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/messageActionAttachMenuBotAllowed"/></para></summary>
|
||||
[TLDef(0xE7E75F97)]
|
||||
public class MessageActionAttachMenuBotAllowed : MessageAction { }
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/messageActionRequestedPeer"/></para></summary>
|
||||
[TLDef(0xFE77345D)]
|
||||
public class MessageActionRequestedPeer : MessageAction
|
||||
|
|
@ -4862,7 +4870,7 @@ namespace TL
|
|||
}
|
||||
|
||||
/// <summary>Current configuration <para>See <a href="https://corefork.telegram.org/constructor/config"/></para></summary>
|
||||
[TLDef(0x232566AC)]
|
||||
[TLDef(0xCC1A241E)]
|
||||
public class Config : IObject
|
||||
{
|
||||
/// <summary>Flags, see <a href="https://corefork.telegram.org/mtproto/TL-combinators#conditional-fields">TL conditional fields</a></summary>
|
||||
|
|
@ -4901,8 +4909,6 @@ namespace TL
|
|||
public int push_chat_period_ms;
|
||||
/// <summary>Not for client use</summary>
|
||||
public int push_chat_limit;
|
||||
/// <summary>Maximum count of saved gifs</summary>
|
||||
public int saved_gifs_limit;
|
||||
/// <summary>Only messages with age smaller than the one specified can be edited</summary>
|
||||
public int edit_time_limit;
|
||||
/// <summary>Only channel/supergroup messages with age smaller than the specified can be deleted</summary>
|
||||
|
|
@ -4913,16 +4919,10 @@ namespace TL
|
|||
public int rating_e_decay;
|
||||
/// <summary>Maximum number of recent stickers</summary>
|
||||
public int stickers_recent_limit;
|
||||
/// <summary>Maximum number of faved stickers</summary>
|
||||
public int stickers_faved_limit;
|
||||
/// <summary>Indicates that round videos (video notes) and voice messages sent in channels and older than the specified period must be marked as read</summary>
|
||||
public int channels_read_media_period;
|
||||
/// <summary>Temporary <a href="https://corefork.telegram.org/passport">passport</a> sessions</summary>
|
||||
[IfFlag(0)] public int tmp_sessions;
|
||||
/// <summary>Maximum count of pinned dialogs</summary>
|
||||
public int pinned_dialogs_count_max;
|
||||
/// <summary>Maximum count of dialogs per folder</summary>
|
||||
public int pinned_infolder_count_max;
|
||||
/// <summary>Maximum allowed outgoing ring time in VoIP calls: if the user we're calling doesn't reply within the specified time (in milliseconds), we should hang up the call</summary>
|
||||
public int call_receive_timeout_ms;
|
||||
/// <summary>Maximum allowed incoming ring time in VoIP calls: if the current user doesn't reply within the specified time (in milliseconds), the call will be automatically refused</summary>
|
||||
|
|
@ -4957,21 +4957,18 @@ namespace TL
|
|||
[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(16)] public string autologin_token;
|
||||
|
||||
[Flags] public enum Flags : uint
|
||||
{
|
||||
/// <summary>Field <see cref="tmp_sessions"/> has a value</summary>
|
||||
has_tmp_sessions = 0x1,
|
||||
/// <summary>Whether phone calls can be used</summary>
|
||||
phonecalls_enabled = 0x2,
|
||||
/// <summary>Field <see cref="suggested_lang_code"/> has a value</summary>
|
||||
has_suggested_lang_code = 0x4,
|
||||
/// <summary>Whether the client should use P2P by default for phone calls with contacts</summary>
|
||||
default_p2p_contacts = 0x8,
|
||||
/// <summary>Whether the client should preload featured stickers</summary>
|
||||
preload_featured_stickers = 0x10,
|
||||
/// <summary>Whether the client should ignore phone <a href="https://corefork.telegram.org/api/entities">entities</a></summary>
|
||||
ignore_phone_entities = 0x20,
|
||||
/// <summary>Whether incoming private messages can be deleted for both participants</summary>
|
||||
revoke_pm_inbox = 0x40,
|
||||
/// <summary>Field <see cref="autoupdate_url_prefix"/> has a value</summary>
|
||||
|
|
@ -4986,12 +4983,12 @@ namespace TL
|
|||
has_img_search_username = 0x800,
|
||||
/// <summary>Field <see cref="static_maps_provider"/> has a value</summary>
|
||||
has_static_maps_provider = 0x1000,
|
||||
/// <summary>Whether <a href="https://corefork.telegram.org/api/pfs">pfs</a> was used</summary>
|
||||
pfs_enabled = 0x2000,
|
||||
/// <summary>Whether to forcefully connect using IPv6 <see cref="DcOption"/>, even if the client knows that IPv4 is available.</summary>
|
||||
force_try_ipv6 = 0x4000,
|
||||
/// <summary>Field <see cref="reactions_default"/> has a value</summary>
|
||||
has_reactions_default = 0x8000,
|
||||
/// <summary>Field <see cref="autologin_token"/> has a value</summary>
|
||||
has_autologin_token = 0x10000,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -7720,7 +7717,7 @@ namespace TL
|
|||
}
|
||||
|
||||
/// <summary>Result of a query to an inline bot <para>See <a href="https://corefork.telegram.org/constructor/messages.botResults"/></para></summary>
|
||||
[TLDef(0x947CA848)]
|
||||
[TLDef(0xE021F2F6)]
|
||||
public class Messages_BotResults : IObject
|
||||
{
|
||||
/// <summary>Flags, see <a href="https://corefork.telegram.org/mtproto/TL-combinators#conditional-fields">TL conditional fields</a></summary>
|
||||
|
|
@ -7731,6 +7728,7 @@ namespace TL
|
|||
[IfFlag(1)] public string next_offset;
|
||||
/// <summary>Whether the bot requested the user to message them in private</summary>
|
||||
[IfFlag(2)] public InlineBotSwitchPM switch_pm;
|
||||
[IfFlag(3)] public InlineBotWebView switch_webview;
|
||||
/// <summary>The results</summary>
|
||||
public BotInlineResultBase[] results;
|
||||
/// <summary>Caching validity of the results</summary>
|
||||
|
|
@ -7746,6 +7744,8 @@ namespace TL
|
|||
has_next_offset = 0x2,
|
||||
/// <summary>Field <see cref="switch_pm"/> has a value</summary>
|
||||
has_switch_pm = 0x4,
|
||||
/// <summary>Field <see cref="switch_webview"/> has a value</summary>
|
||||
has_switch_webview = 0x8,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -9293,7 +9293,7 @@ namespace TL
|
|||
}
|
||||
|
||||
/// <summary>Sticker in a stickerset <para>See <a href="https://corefork.telegram.org/constructor/inputStickerSetItem"/></para></summary>
|
||||
[TLDef(0xFFA0A496)]
|
||||
[TLDef(0x32DA9E9C)]
|
||||
public class InputStickerSetItem : IObject
|
||||
{
|
||||
/// <summary>Flags, see <a href="https://corefork.telegram.org/mtproto/TL-combinators#conditional-fields">TL conditional fields</a></summary>
|
||||
|
|
@ -9304,11 +9304,14 @@ namespace TL
|
|||
public string emoji;
|
||||
/// <summary>Coordinates for mask sticker</summary>
|
||||
[IfFlag(0)] public MaskCoords mask_coords;
|
||||
[IfFlag(1)] public string keywords;
|
||||
|
||||
[Flags] public enum Flags : uint
|
||||
{
|
||||
/// <summary>Field <see cref="mask_coords"/> has a value</summary>
|
||||
has_mask_coords = 0x1,
|
||||
/// <summary>Field <see cref="keywords"/> has a value</summary>
|
||||
has_keywords = 0x2,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -13124,7 +13127,7 @@ namespace TL
|
|||
public class Account_ResetPasswordOk : Account_ResetPasswordResult { }
|
||||
|
||||
/// <summary>A <a href="https://corefork.telegram.org/api/sponsored-messages">sponsored message</a>. <para>See <a href="https://corefork.telegram.org/constructor/sponsoredMessage"/></para></summary>
|
||||
[TLDef(0x3A836DF8)]
|
||||
[TLDef(0xFC25B828)]
|
||||
public class SponsoredMessage : IObject
|
||||
{
|
||||
/// <summary>Flags, see <a href="https://corefork.telegram.org/mtproto/TL-combinators#conditional-fields">TL conditional fields</a></summary>
|
||||
|
|
@ -13145,6 +13148,8 @@ namespace TL
|
|||
public string message;
|
||||
/// <summary><a href="https://corefork.telegram.org/api/entities">Message entities for styled text</a></summary>
|
||||
[IfFlag(1)] public MessageEntity[] entities;
|
||||
[IfFlag(7)] public string sponsor_info;
|
||||
[IfFlag(8)] public string additional_info;
|
||||
|
||||
[Flags] public enum Flags : uint
|
||||
{
|
||||
|
|
@ -13161,6 +13166,10 @@ namespace TL
|
|||
/// <summary>Whether the message needs to be labeled as "recommended" instead of "sponsored"</summary>
|
||||
recommended = 0x20,
|
||||
show_peer_photo = 0x40,
|
||||
/// <summary>Field <see cref="sponsor_info"/> has a value</summary>
|
||||
has_sponsor_info = 0x80,
|
||||
/// <summary>Field <see cref="additional_info"/> has a value</summary>
|
||||
has_additional_info = 0x100,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -14245,4 +14254,90 @@ namespace TL
|
|||
/// <summary>returns a <see cref="User"/> or <see cref="ChatBase"/> for the given Peer</summary>
|
||||
public IPeerInfo UserOrChat(Peer peer) => peer?.UserOrChat(users, chats);
|
||||
}
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/help.appConfig"/></para></summary>
|
||||
/// <remarks>a <see langword="null"/> value means <a href="https://corefork.telegram.org/constructor/help.appConfigNotModified">help.appConfigNotModified</a></remarks>
|
||||
[TLDef(0xDD18782E)]
|
||||
public class Help_AppConfig : IObject
|
||||
{
|
||||
public int hash;
|
||||
public JsonObject config;
|
||||
}
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/type/InputBotApp"/></para></summary>
|
||||
public abstract class InputBotApp : IObject { }
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/inputBotAppID"/></para></summary>
|
||||
[TLDef(0xA920BD7A)]
|
||||
public class InputBotAppID : InputBotApp
|
||||
{
|
||||
public long id;
|
||||
public long access_hash;
|
||||
}
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/inputBotAppShortName"/></para></summary>
|
||||
[TLDef(0x908C0407)]
|
||||
public class InputBotAppShortName : InputBotApp
|
||||
{
|
||||
public InputUserBase bot_id;
|
||||
public string short_name;
|
||||
}
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/botApp"/></para></summary>
|
||||
/// <remarks>a <see langword="null"/> value means <a href="https://corefork.telegram.org/constructor/botAppNotModified">botAppNotModified</a></remarks>
|
||||
[TLDef(0x95FCD1D6)]
|
||||
public class BotApp : IObject
|
||||
{
|
||||
public Flags flags;
|
||||
public long id;
|
||||
public long access_hash;
|
||||
public string short_name;
|
||||
public string title;
|
||||
public string description;
|
||||
public PhotoBase photo;
|
||||
[IfFlag(0)] public DocumentBase document;
|
||||
public long hash;
|
||||
|
||||
[Flags] public enum Flags : uint
|
||||
{
|
||||
has_document = 0x1,
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/messages.botApp"/></para></summary>
|
||||
[TLDef(0xEB50ADF5)]
|
||||
public class Messages_BotApp : IObject
|
||||
{
|
||||
public Flags flags;
|
||||
public BotApp app;
|
||||
|
||||
[Flags] public enum Flags : uint
|
||||
{
|
||||
inactive = 0x1,
|
||||
request_write_access = 0x2,
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/type/AppWebViewResult"/></para></summary>
|
||||
public abstract class AppWebViewResult : IObject { }
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/appWebViewResultUrl"/></para></summary>
|
||||
[TLDef(0x3C1B4F0D)]
|
||||
public class AppWebViewResultUrl : AppWebViewResult
|
||||
{
|
||||
public string url;
|
||||
}
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/inlineBotWebView"/></para></summary>
|
||||
[TLDef(0xB57295D5)]
|
||||
public class InlineBotWebView : IObject
|
||||
{
|
||||
public string text;
|
||||
public string url;
|
||||
}
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/readParticipantDate"/></para></summary>
|
||||
[TLDef(0x4A4FF172)]
|
||||
public class ReadParticipantDate : IObject
|
||||
{
|
||||
public long user_id;
|
||||
public DateTime date;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2044,15 +2044,16 @@ namespace TL
|
|||
/// <param name="cache_time">The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300.</param>
|
||||
/// <param name="next_offset">Pass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don't support pagination. Offset length can't exceed 64 bytes.</param>
|
||||
/// <param name="switch_pm">If passed, clients will display a button with specified text that switches the user to a private chat with the bot and sends the bot a start message with a certain parameter.</param>
|
||||
public static Task<bool> Messages_SetInlineBotResults(this Client client, long query_id, InputBotInlineResultBase[] results, DateTime cache_time, string next_offset = null, InlineBotSwitchPM switch_pm = null, bool gallery = false, bool private_ = false)
|
||||
public static Task<bool> Messages_SetInlineBotResults(this Client client, long query_id, InputBotInlineResultBase[] results, DateTime cache_time, string next_offset = null, InlineBotSwitchPM switch_pm = null, InlineBotWebView switch_webview = null, bool gallery = false, bool private_ = false)
|
||||
=> client.Invoke(new Messages_SetInlineBotResults
|
||||
{
|
||||
flags = (Messages_SetInlineBotResults.Flags)((next_offset != null ? 0x4 : 0) | (switch_pm != null ? 0x8 : 0) | (gallery ? 0x1 : 0) | (private_ ? 0x2 : 0)),
|
||||
flags = (Messages_SetInlineBotResults.Flags)((next_offset != null ? 0x4 : 0) | (switch_pm != null ? 0x8 : 0) | (switch_webview != null ? 0x10 : 0) | (gallery ? 0x1 : 0) | (private_ ? 0x2 : 0)),
|
||||
query_id = query_id,
|
||||
results = results,
|
||||
cache_time = cache_time,
|
||||
next_offset = next_offset,
|
||||
switch_pm = switch_pm,
|
||||
switch_webview = switch_webview,
|
||||
});
|
||||
|
||||
/// <summary>Send a result obtained using <see cref="Messages_GetInlineBotResults">Messages_GetInlineBotResults</see>. <para>See <a href="https://corefork.telegram.org/method/messages.sendInlineBotResult"/></para> <para>Possible <see cref="RpcException"/> codes: 400,403,420,500 (<a href="https://corefork.telegram.org/method/messages.sendInlineBotResult#possible-errors">details</a>)</para></summary>
|
||||
|
|
@ -3076,7 +3077,7 @@ namespace TL
|
|||
/// <summary>Get which users read a specific message: only available for groups and supergroups with less than <a href="https://corefork.telegram.org/api/config#chat-read-mark-size-threshold"><c>chat_read_mark_size_threshold</c> members</a>, read receipts will be stored for <a href="https://corefork.telegram.org/api/config#chat-read-mark-expire-period"><c>chat_read_mark_expire_period</c> seconds after the message was sent</a>, see <a href="https://corefork.telegram.org/api/config#client-configuration">client configuration for more info »</a>. <para>See <a href="https://corefork.telegram.org/method/messages.getMessageReadParticipants"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/messages.getMessageReadParticipants#possible-errors">details</a>)</para></summary>
|
||||
/// <param name="peer">Dialog</param>
|
||||
/// <param name="msg_id">Message ID</param>
|
||||
public static Task<long[]> Messages_GetMessageReadParticipants(this Client client, InputPeer peer, int msg_id)
|
||||
public static Task<ReadParticipantDate[]> Messages_GetMessageReadParticipants(this Client client, InputPeer peer, int msg_id)
|
||||
=> client.Invoke(new Messages_GetMessageReadParticipants
|
||||
{
|
||||
peer = peer,
|
||||
|
|
@ -3358,10 +3359,10 @@ namespace TL
|
|||
/// <param name="url">Web app URL</param>
|
||||
/// <param name="theme_params"><a href="https://corefork.telegram.org/api/bots/webapps#theme-parameters">Theme parameters »</a></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, bool from_switch_webview = false)
|
||||
=> client.Invoke(new Messages_RequestSimpleWebView
|
||||
{
|
||||
flags = (Messages_RequestSimpleWebView.Flags)(theme_params != null ? 0x1 : 0),
|
||||
flags = (Messages_RequestSimpleWebView.Flags)((theme_params != null ? 0x1 : 0) | (from_switch_webview ? 0x2 : 0)),
|
||||
bot = bot,
|
||||
url = url,
|
||||
theme_params = theme_params,
|
||||
|
|
@ -3553,6 +3554,26 @@ namespace TL
|
|||
peer = peer,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/messages.getBotApp"/></para></summary>
|
||||
public static Task<Messages_BotApp> Messages_GetBotApp(this Client client, InputBotApp app, long hash = default)
|
||||
=> client.Invoke(new Messages_GetBotApp
|
||||
{
|
||||
app = app,
|
||||
hash = hash,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/messages.requestAppWebView"/></para></summary>
|
||||
public static Task<AppWebViewResult> Messages_RequestAppWebView(this Client client, InputPeer peer, InputBotApp app, string platform, string start_param = null, DataJSON theme_params = null, bool write_allowed = false)
|
||||
=> client.Invoke(new Messages_RequestAppWebView
|
||||
{
|
||||
flags = (Messages_RequestAppWebView.Flags)((start_param != null ? 0x2 : 0) | (theme_params != null ? 0x4 : 0) | (write_allowed ? 0x1 : 0)),
|
||||
peer = peer,
|
||||
app = app,
|
||||
start_param = start_param,
|
||||
theme_params = theme_params,
|
||||
platform = platform,
|
||||
});
|
||||
|
||||
/// <summary>Returns a current state of updates. <para>See <a href="https://corefork.telegram.org/method/updates.getState"/> [bots: ✓]</para></summary>
|
||||
public static Task<Updates_State> Updates_GetState(this Client client)
|
||||
=> client.Invoke(new Updates_GetState
|
||||
|
|
@ -3831,9 +3852,11 @@ namespace TL
|
|||
});
|
||||
|
||||
/// <summary>Get app-specific configuration, see <a href="https://corefork.telegram.org/api/config#client-configuration">client configuration</a> for more info on the result. <para>See <a href="https://corefork.telegram.org/method/help.getAppConfig"/></para></summary>
|
||||
public static Task<JsonObject> Help_GetAppConfig(this Client client)
|
||||
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/help.appConfigNotModified">help.appConfigNotModified</a></returns>
|
||||
public static Task<Help_AppConfig> Help_GetAppConfig(this Client client, int hash = default)
|
||||
=> client.Invoke(new Help_GetAppConfig
|
||||
{
|
||||
hash = hash,
|
||||
});
|
||||
|
||||
/// <summary>Saves logs of application on the server. <para>See <a href="https://corefork.telegram.org/method/help.saveAppLog"/></para></summary>
|
||||
|
|
@ -4566,6 +4589,23 @@ namespace TL
|
|||
admin_rights = admin_rights,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/bots.setBotInfo"/></para></summary>
|
||||
public static Task<bool> Bots_SetBotInfo(this Client client, string lang_code, string about = null, string description = null)
|
||||
=> client.Invoke(new Bots_SetBotInfo
|
||||
{
|
||||
flags = (Bots_SetBotInfo.Flags)((about != null ? 0x1 : 0) | (description != null ? 0x2 : 0)),
|
||||
lang_code = lang_code,
|
||||
about = about,
|
||||
description = description,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/bots.getBotInfo"/></para></summary>
|
||||
public static Task<string[]> Bots_GetBotInfo(this Client client, string lang_code)
|
||||
=> client.Invoke(new Bots_GetBotInfo
|
||||
{
|
||||
lang_code = lang_code,
|
||||
});
|
||||
|
||||
/// <summary>Get a payment form <para>See <a href="https://corefork.telegram.org/method/payments.getPaymentForm"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/payments.getPaymentForm#possible-errors">details</a>)</para></summary>
|
||||
/// <param name="invoice">Invoice</param>
|
||||
/// <param name="theme_params">A JSON object with the following keys, containing color theme information (integers, RGB24) to pass to the payment provider, to apply in eventual verification pages: <br/><c>bg_color</c> - Background color <br/><c>text_color</c> - Text color <br/><c>hint_color</c> - Hint text color <br/><c>link_color</c> - Link color <br/><c>button_color</c> - Button color <br/><c>button_text_color</c> - Button text color</param>
|
||||
|
|
@ -4688,10 +4728,10 @@ namespace TL
|
|||
/// <param name="stickers">Stickers</param>
|
||||
/// <param name="software">Used when <a href="https://corefork.telegram.org/import-stickers">importing stickers using the sticker import SDKs</a>, specifies the name of the software that created the stickers</param>
|
||||
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/messages.stickerSetNotModified">messages.stickerSetNotModified</a></returns>
|
||||
public static Task<Messages_StickerSet> Stickers_CreateStickerSet(this Client client, InputUserBase user_id, string title, string short_name, InputStickerSetItem[] stickers, InputDocument thumb = null, string software = null, bool masks = false, bool animated = false, bool videos = false)
|
||||
public static Task<Messages_StickerSet> Stickers_CreateStickerSet(this Client client, InputUserBase user_id, string title, string short_name, InputStickerSetItem[] stickers, InputDocument thumb = null, string software = null, bool masks = false, bool animated = false, bool videos = false, bool emojis = false, bool text_color = false)
|
||||
=> client.Invoke(new Stickers_CreateStickerSet
|
||||
{
|
||||
flags = (Stickers_CreateStickerSet.Flags)((thumb != null ? 0x4 : 0) | (software != null ? 0x8 : 0) | (masks ? 0x1 : 0) | (animated ? 0x2 : 0) | (videos ? 0x10 : 0)),
|
||||
flags = (Stickers_CreateStickerSet.Flags)((thumb != null ? 0x4 : 0) | (software != null ? 0x8 : 0) | (masks ? 0x1 : 0) | (animated ? 0x2 : 0) | (videos ? 0x10 : 0) | (emojis ? 0x20 : 0) | (text_color ? 0x40 : 0)),
|
||||
user_id = user_id,
|
||||
title = title,
|
||||
short_name = short_name,
|
||||
|
|
@ -4735,11 +4775,13 @@ namespace TL
|
|||
/// <param name="stickerset">Stickerset</param>
|
||||
/// <param name="thumb">Thumbnail</param>
|
||||
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/messages.stickerSetNotModified">messages.stickerSetNotModified</a></returns>
|
||||
public static Task<Messages_StickerSet> Stickers_SetStickerSetThumb(this Client client, InputStickerSet stickerset, InputDocument thumb)
|
||||
public static Task<Messages_StickerSet> Stickers_SetStickerSetThumb(this Client client, InputStickerSet stickerset, InputDocument thumb = null, long? thumb_document_id = null)
|
||||
=> client.Invoke(new Stickers_SetStickerSetThumb
|
||||
{
|
||||
flags = (Stickers_SetStickerSetThumb.Flags)((thumb != null ? 0x1 : 0) | (thumb_document_id != null ? 0x2 : 0)),
|
||||
stickerset = stickerset,
|
||||
thumb = thumb,
|
||||
thumb_document_id = thumb_document_id.GetValueOrDefault(),
|
||||
});
|
||||
|
||||
/// <summary>Check whether the given short name is available <para>See <a href="https://corefork.telegram.org/method/stickers.checkShortName"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/stickers.checkShortName#possible-errors">details</a>)</para></summary>
|
||||
|
|
@ -4758,6 +4800,34 @@ namespace TL
|
|||
title = title,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/stickers.changeSticker"/></para></summary>
|
||||
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/messages.stickerSetNotModified">messages.stickerSetNotModified</a></returns>
|
||||
public static Task<Messages_StickerSet> Stickers_ChangeSticker(this Client client, InputDocument sticker, string emoji = null, MaskCoords mask_coords = null, string keywords = null)
|
||||
=> client.Invoke(new Stickers_ChangeSticker
|
||||
{
|
||||
flags = (Stickers_ChangeSticker.Flags)((emoji != null ? 0x1 : 0) | (mask_coords != null ? 0x2 : 0) | (keywords != null ? 0x4 : 0)),
|
||||
sticker = sticker,
|
||||
emoji = emoji,
|
||||
mask_coords = mask_coords,
|
||||
keywords = keywords,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/stickers.renameStickerSet"/></para></summary>
|
||||
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/messages.stickerSetNotModified">messages.stickerSetNotModified</a></returns>
|
||||
public static Task<Messages_StickerSet> Stickers_RenameStickerSet(this Client client, InputStickerSet stickerset, string title)
|
||||
=> client.Invoke(new Stickers_RenameStickerSet
|
||||
{
|
||||
stickerset = stickerset,
|
||||
title = title,
|
||||
});
|
||||
|
||||
/// <summary><para>See <a href="https://corefork.telegram.org/method/stickers.deleteStickerSet"/></para></summary>
|
||||
public static Task<bool> Stickers_DeleteStickerSet(this Client client, InputStickerSet stickerset)
|
||||
=> client.Invoke(new Stickers_DeleteStickerSet
|
||||
{
|
||||
stickerset = stickerset,
|
||||
});
|
||||
|
||||
/// <summary>Get phone call configuration to be passed to libtgvoip's shared config <para>See <a href="https://corefork.telegram.org/method/phone.getCallConfig"/></para></summary>
|
||||
public static Task<DataJSON> Phone_GetCallConfig(this Client client)
|
||||
=> client.Invoke(new Phone_GetCallConfig
|
||||
|
|
@ -6861,7 +6931,7 @@ namespace TL.Methods
|
|||
}
|
||||
}
|
||||
|
||||
[TLDef(0xEB5EA206)]
|
||||
[TLDef(0xBB12A419)]
|
||||
public class Messages_SetInlineBotResults : IMethod<bool>
|
||||
{
|
||||
public Flags flags;
|
||||
|
|
@ -6870,6 +6940,7 @@ namespace TL.Methods
|
|||
public DateTime cache_time;
|
||||
[IfFlag(2)] public string next_offset;
|
||||
[IfFlag(3)] public InlineBotSwitchPM switch_pm;
|
||||
[IfFlag(4)] public InlineBotWebView switch_webview;
|
||||
|
||||
[Flags] public enum Flags : uint
|
||||
{
|
||||
|
|
@ -6877,6 +6948,7 @@ namespace TL.Methods
|
|||
private_ = 0x2,
|
||||
has_next_offset = 0x4,
|
||||
has_switch_pm = 0x8,
|
||||
has_switch_webview = 0x10,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -7765,8 +7837,8 @@ namespace TL.Methods
|
|||
public string emoticon;
|
||||
}
|
||||
|
||||
[TLDef(0x2C6F97B7)]
|
||||
public class Messages_GetMessageReadParticipants : IMethod<long[]>
|
||||
[TLDef(0x31C1C44F)]
|
||||
public class Messages_GetMessageReadParticipants : IMethod<ReadParticipantDate[]>
|
||||
{
|
||||
public InputPeer peer;
|
||||
public int msg_id;
|
||||
|
|
@ -8029,6 +8101,7 @@ namespace TL.Methods
|
|||
[Flags] public enum Flags : uint
|
||||
{
|
||||
has_theme_params = 0x1,
|
||||
from_switch_webview = 0x2,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -8169,6 +8242,31 @@ namespace TL.Methods
|
|||
}
|
||||
}
|
||||
|
||||
[TLDef(0x34FDC5C3)]
|
||||
public class Messages_GetBotApp : IMethod<Messages_BotApp>
|
||||
{
|
||||
public InputBotApp app;
|
||||
public long hash;
|
||||
}
|
||||
|
||||
[TLDef(0x8C5A3B3C)]
|
||||
public class Messages_RequestAppWebView : IMethod<AppWebViewResult>
|
||||
{
|
||||
public Flags flags;
|
||||
public InputPeer peer;
|
||||
public InputBotApp app;
|
||||
[IfFlag(1)] public string start_param;
|
||||
[IfFlag(2)] public DataJSON theme_params;
|
||||
public string platform;
|
||||
|
||||
[Flags] public enum Flags : uint
|
||||
{
|
||||
write_allowed = 0x1,
|
||||
has_start_param = 0x2,
|
||||
has_theme_params = 0x4,
|
||||
}
|
||||
}
|
||||
|
||||
[TLDef(0xEDD4882A)]
|
||||
public class Updates_GetState : IMethod<Updates_State> { }
|
||||
|
||||
|
|
@ -8393,8 +8491,11 @@ namespace TL.Methods
|
|||
public string path;
|
||||
}
|
||||
|
||||
[TLDef(0x98914110)]
|
||||
public class Help_GetAppConfig : IMethod<JsonObject> { }
|
||||
[TLDef(0x61E3F854)]
|
||||
public class Help_GetAppConfig : IMethod<Help_AppConfig>
|
||||
{
|
||||
public int hash;
|
||||
}
|
||||
|
||||
[TLDef(0x6F02F748)]
|
||||
public class Help_SaveAppLog : IMethod<bool>
|
||||
|
|
@ -8975,6 +9076,27 @@ namespace TL.Methods
|
|||
public ChatAdminRights admin_rights;
|
||||
}
|
||||
|
||||
[TLDef(0xA365DF7A)]
|
||||
public class Bots_SetBotInfo : IMethod<bool>
|
||||
{
|
||||
public Flags flags;
|
||||
public string lang_code;
|
||||
[IfFlag(0)] public string about;
|
||||
[IfFlag(1)] public string description;
|
||||
|
||||
[Flags] public enum Flags : uint
|
||||
{
|
||||
has_about = 0x1,
|
||||
has_description = 0x2,
|
||||
}
|
||||
}
|
||||
|
||||
[TLDef(0x75EC12E6)]
|
||||
public class Bots_GetBotInfo : IMethod<string[]>
|
||||
{
|
||||
public string lang_code;
|
||||
}
|
||||
|
||||
[TLDef(0x37148DBB)]
|
||||
public class Payments_GetPaymentForm : IMethod<Payments_PaymentForm>
|
||||
{
|
||||
|
|
@ -9092,6 +9214,8 @@ namespace TL.Methods
|
|||
has_thumb = 0x4,
|
||||
has_software = 0x8,
|
||||
videos = 0x10,
|
||||
emojis = 0x20,
|
||||
text_color = 0x40,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -9115,11 +9239,19 @@ namespace TL.Methods
|
|||
public InputStickerSetItem sticker;
|
||||
}
|
||||
|
||||
[TLDef(0x9A364E30)]
|
||||
[TLDef(0xA76A5392)]
|
||||
public class Stickers_SetStickerSetThumb : IMethod<Messages_StickerSet>
|
||||
{
|
||||
public Flags flags;
|
||||
public InputStickerSet stickerset;
|
||||
public InputDocument thumb;
|
||||
[IfFlag(0)] public InputDocument thumb;
|
||||
[IfFlag(1)] public long thumb_document_id;
|
||||
|
||||
[Flags] public enum Flags : uint
|
||||
{
|
||||
has_thumb = 0x1,
|
||||
has_thumb_document_id = 0x2,
|
||||
}
|
||||
}
|
||||
|
||||
[TLDef(0x284B3639)]
|
||||
|
|
@ -9134,6 +9266,36 @@ namespace TL.Methods
|
|||
public string title;
|
||||
}
|
||||
|
||||
[TLDef(0xF5537EBC)]
|
||||
public class Stickers_ChangeSticker : IMethod<Messages_StickerSet>
|
||||
{
|
||||
public Flags flags;
|
||||
public InputDocument sticker;
|
||||
[IfFlag(0)] public string emoji;
|
||||
[IfFlag(1)] public MaskCoords mask_coords;
|
||||
[IfFlag(2)] public string keywords;
|
||||
|
||||
[Flags] public enum Flags : uint
|
||||
{
|
||||
has_emoji = 0x1,
|
||||
has_mask_coords = 0x2,
|
||||
has_keywords = 0x4,
|
||||
}
|
||||
}
|
||||
|
||||
[TLDef(0x124B1C00)]
|
||||
public class Stickers_RenameStickerSet : IMethod<Messages_StickerSet>
|
||||
{
|
||||
public InputStickerSet stickerset;
|
||||
public string title;
|
||||
}
|
||||
|
||||
[TLDef(0x87704394)]
|
||||
public class Stickers_DeleteStickerSet : IMethod<bool>
|
||||
{
|
||||
public InputStickerSet stickerset;
|
||||
}
|
||||
|
||||
[TLDef(0x55451FA9)]
|
||||
public class Phone_GetCallConfig : IMethod<DataJSON> { }
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ namespace TL
|
|||
{
|
||||
public static class Layer
|
||||
{
|
||||
public const int Version = 152; // fetched 03/02/2023 21:46:20
|
||||
public const int Version = 154; // fetched 08/03/2023 19:08:02
|
||||
internal const int SecretChats = 144;
|
||||
internal const int MTProto2 = 73;
|
||||
internal const uint VectorCtor = 0x1CB5C415;
|
||||
|
|
@ -177,7 +177,7 @@ namespace TL
|
|||
[0x80E11A7F] = typeof(MessageActionPhoneCall),
|
||||
[0x4792929B] = typeof(MessageActionScreenshotTaken),
|
||||
[0xFAE69F56] = typeof(MessageActionCustomAction),
|
||||
[0xABE9AFFE] = typeof(MessageActionBotAllowed),
|
||||
[0xC516D679] = typeof(MessageActionBotAllowed),
|
||||
[0x1B287353] = typeof(MessageActionSecureValuesSentMe),
|
||||
[0xD95C6154] = typeof(MessageActionSecureValuesSent),
|
||||
[0xF3F25F76] = typeof(MessageActionContactSignUp),
|
||||
|
|
@ -194,7 +194,6 @@ namespace TL
|
|||
[0x0D999256] = typeof(MessageActionTopicCreate),
|
||||
[0xC0944820] = typeof(MessageActionTopicEdit),
|
||||
[0x57DE635E] = typeof(MessageActionSuggestProfilePhoto),
|
||||
[0xE7E75F97] = typeof(MessageActionAttachMenuBotAllowed),
|
||||
[0xFE77345D] = typeof(MessageActionRequestedPeer),
|
||||
[0xD58A08C6] = typeof(Dialog),
|
||||
[0x71BD134C] = typeof(DialogFolder),
|
||||
|
|
@ -388,7 +387,7 @@ namespace TL
|
|||
[0x096A18D5] = typeof(Upload_File),
|
||||
[0xF18CDA44] = typeof(Upload_FileCdnRedirect),
|
||||
[0x18B7A10D] = typeof(DcOption),
|
||||
[0x232566AC] = typeof(Config),
|
||||
[0xCC1A241E] = typeof(Config),
|
||||
[0x8E1A1775] = typeof(NearestDc),
|
||||
[0xCCBBCE30] = typeof(Help_AppUpdate),
|
||||
[0xC45A6536] = null,//Help_NoAppUpdate
|
||||
|
|
@ -594,7 +593,7 @@ namespace TL
|
|||
[0x354A9B09] = typeof(BotInlineMessageMediaInvoice),
|
||||
[0x11965F3A] = typeof(BotInlineResult),
|
||||
[0x17DB940B] = typeof(BotInlineMediaResult),
|
||||
[0x947CA848] = typeof(Messages_BotResults),
|
||||
[0xE021F2F6] = typeof(Messages_BotResults),
|
||||
[0x5DAB1AF4] = typeof(ExportedMessageLink),
|
||||
[0x5F777DCE] = typeof(MessageFwdHeader),
|
||||
[0x3DBB5986] = typeof(Auth_SentCodeTypeApp),
|
||||
|
|
@ -709,7 +708,7 @@ namespace TL
|
|||
[0x8AC32801] = typeof(InputPaymentCredentialsGooglePay),
|
||||
[0xDB64FD34] = typeof(Account_TmpPassword),
|
||||
[0xB6213CDF] = typeof(ShippingOption),
|
||||
[0xFFA0A496] = typeof(InputStickerSetItem),
|
||||
[0x32DA9E9C] = typeof(InputStickerSetItem),
|
||||
[0x1E36FDED] = typeof(InputPhoneCall),
|
||||
[0x5366C915] = typeof(PhoneCallEmpty),
|
||||
[0xC5226F17] = typeof(PhoneCallWaiting),
|
||||
|
|
@ -977,7 +976,7 @@ namespace TL
|
|||
[0xE3779861] = typeof(Account_ResetPasswordFailedWait),
|
||||
[0xE9EFFC7D] = typeof(Account_ResetPasswordRequestedWait),
|
||||
[0xE926D63E] = typeof(Account_ResetPasswordOk),
|
||||
[0x3A836DF8] = typeof(SponsoredMessage),
|
||||
[0xFC25B828] = typeof(SponsoredMessage),
|
||||
[0xC9EE1D87] = typeof(Messages_SponsoredMessages),
|
||||
[0x1839490F] = null,//Messages_SponsoredMessagesEmpty
|
||||
[0xC9B0539F] = typeof(SearchResultsCalendarPeriod),
|
||||
|
|
@ -1072,6 +1071,16 @@ namespace TL
|
|||
[0xC84834CE] = typeof(AutoSaveSettings),
|
||||
[0x81602D47] = typeof(AutoSaveException),
|
||||
[0x4C3E069D] = typeof(Account_AutoSaveSettings),
|
||||
[0x7CDE641D] = null,//Help_AppConfigNotModified
|
||||
[0xDD18782E] = typeof(Help_AppConfig),
|
||||
[0xA920BD7A] = typeof(InputBotAppID),
|
||||
[0x908C0407] = typeof(InputBotAppShortName),
|
||||
[0x5DA674B7] = null,//BotAppNotModified
|
||||
[0x95FCD1D6] = typeof(BotApp),
|
||||
[0xEB50ADF5] = typeof(Messages_BotApp),
|
||||
[0x3C1B4F0D] = typeof(AppWebViewResultUrl),
|
||||
[0xB57295D5] = typeof(InlineBotWebView),
|
||||
[0x4A4FF172] = typeof(ReadParticipantDate),
|
||||
// from TL.Secret:
|
||||
[0x6ABD9782] = typeof(Layer143.DecryptedMessageMediaDocument),
|
||||
[0x91CC4674] = typeof(Layer73.DecryptedMessage),
|
||||
|
|
@ -1190,6 +1199,8 @@ namespace TL
|
|||
// from TL.Secret:
|
||||
[typeof(EmojiList)] = 0x481EADFA, //emojiListNotModified
|
||||
[typeof(Messages_EmojiGroups)] = 0x6FB4AD87, //messages.emojiGroupsNotModified
|
||||
[typeof(Help_AppConfig)] = 0x7CDE641D, //help.appConfigNotModified
|
||||
[typeof(BotApp)] = 0x5DA674B7, //botAppNotModified
|
||||
[typeof(DecryptedMessageMedia)] = 0x089F5C4A, //decryptedMessageMediaEmpty
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
<PackageId>WTelegramClient</PackageId>
|
||||
<Version>0.0.0</Version>
|
||||
<Authors>Wizou</Authors>
|
||||
<Description>Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 152 Release Notes: $(ReleaseNotes.Replace("|", "%0D%0A").Replace(" - ","%0D%0A- ").Replace(" ", "%0D%0A%0D%0A"))</Description>
|
||||
<Description>Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 154 Release Notes: $(ReleaseNotes.Replace("|", "%0D%0A").Replace(" - ","%0D%0A- ").Replace(" ", "%0D%0A%0D%0A"))</Description>
|
||||
<Copyright>Copyright © Olivier Marcoux 2021-2023</Copyright>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<PackageProjectUrl>https://github.com/wiz0u/WTelegramClient</PackageProjectUrl>
|
||||
|
|
|
|||
Loading…
Reference in a new issue