diff --git a/Examples/FileWatcher/FileWatcher.csproj b/Examples/FileWatcher/FileWatcher.csproj
new file mode 100644
index 0000000..9525d9c
--- /dev/null
+++ b/Examples/FileWatcher/FileWatcher.csproj
@@ -0,0 +1,14 @@
+
+
+
+ Exe
+ net8.0
+ enable
+ enable
+
+
+
+
+
+
+
diff --git a/Examples/FileWatcher/Forms/Start.cs b/Examples/FileWatcher/Forms/Start.cs
new file mode 100644
index 0000000..32c1d65
--- /dev/null
+++ b/Examples/FileWatcher/Forms/Start.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using TelegramBotBase.Base;
+using TelegramBotBase.Form;
+
+namespace FileWatcher.Forms
+{
+ public class Start : FormBase
+ {
+
+ public override async Task Load(MessageResult message)
+ {
+
+ await Device.Send("I'm here !");
+ }
+ }
+}
diff --git a/Examples/FileWatcher/Model/Config.cs b/Examples/FileWatcher/Model/Config.cs
new file mode 100644
index 0000000..144b8d9
--- /dev/null
+++ b/Examples/FileWatcher/Model/Config.cs
@@ -0,0 +1,73 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+namespace FileWatcher.Model
+{
+ public class Config
+ {
+
+ public String APIKey { get; set; } = "";
+
+ public String DirectoryToWatch { get; set; } = "";
+
+ public List DeviceIds { get; set; } = new List();
+
+ public static Config Load()
+ {
+ Config config = new Config();
+
+ var path = Path.Combine(Directory.GetCurrentDirectory(), "config.json");
+
+ try
+ {
+ if (!File.Exists(path))
+ {
+ config.Save();
+ }
+
+ var content = File.ReadAllText(path);
+
+ config = JsonSerializer.Deserialize(content);
+ }
+ catch
+ {
+
+ }
+
+
+ return config;
+ }
+
+ public void Save()
+ {
+ var path = Path.Combine(Directory.GetCurrentDirectory(), "config.json");
+
+ Save(path);
+ }
+
+ public void Save(String path)
+ {
+
+ try
+ {
+ if (File.Exists(path))
+ File.Delete(path);
+
+
+ var content = System.Text.Json.JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
+
+ File.WriteAllText(path, content);
+ }
+ catch
+ {
+
+ }
+
+ }
+
+ }
+}
diff --git a/Examples/FileWatcher/Program.cs b/Examples/FileWatcher/Program.cs
new file mode 100644
index 0000000..33fb5d0
--- /dev/null
+++ b/Examples/FileWatcher/Program.cs
@@ -0,0 +1,124 @@
+using Telegram.Bot;
+using TelegramBotBase.Builder;
+using TelegramBotBase.Commands;
+
+namespace FileWatcher
+{
+ internal class Program
+ {
+ public static Model.Config Config { get; set; }
+
+ public static TelegramBotBase.BotBase Bot { get; set; }
+
+ static void Main(string[] args)
+ {
+
+ Config = Model.Config.Load();
+
+ if (string.IsNullOrEmpty(Config.APIKey))
+ {
+ Console.WriteLine("No API Key set");
+ return;
+ }
+
+ if (string.IsNullOrEmpty(Config.DirectoryToWatch))
+ {
+ Console.WriteLine("No directory set");
+ return;
+ }
+
+ FileSystemWatcher watcher = new FileSystemWatcher(Config.DirectoryToWatch);
+ watcher.IncludeSubdirectories = false;
+
+ Console.WriteLine($"Directory: {Config.DirectoryToWatch}");
+
+
+
+ Bot = BotBaseBuilder.Create()
+ .WithAPIKey(Config.APIKey)
+ .DefaultMessageLoop()
+ .WithStartForm()
+ .NoProxy()
+ .CustomCommands(a =>
+ {
+ a.Start("Starts the bot");
+ a.Add("myid", "Whats my id?");
+
+ })
+ .NoSerialization()
+ .UseGerman()
+ .UseSingleThread()
+ .Build();
+
+ Bot.BotCommand += Bot_BotCommand;
+
+ Bot.UploadBotCommands();
+
+ Bot.Start();
+
+ watcher.EnableRaisingEvents = true;
+
+ watcher.Created += Watcher_Created;
+ watcher.Changed += Watcher_Changed;
+ watcher.Renamed += Watcher_Renamed;
+
+ Console.WriteLine("Bot started.");
+
+
+ Console.ReadLine();
+
+ watcher.EnableRaisingEvents = false;
+
+ Bot.Stop();
+
+ }
+
+
+
+ private static async Task Bot_BotCommand(object sender, TelegramBotBase.Args.BotCommandEventArgs e)
+ {
+ switch (e.Command)
+ {
+ case "/myid":
+
+ await e.Device.Send($"Your ID is: {e.DeviceId}");
+
+ e.Handled = true;
+
+ break;
+
+
+ }
+ }
+
+ private static async void Watcher_Changed(object sender, FileSystemEventArgs e)
+ {
+ Console.WriteLine($"File '{e.Name}' changed");
+
+ foreach (var device in Config.DeviceIds)
+ {
+ await Bot.Client.TelegramClient.SendTextMessageAsync(device, $"File '{e.Name}' changed");
+ }
+ }
+
+ private static async void Watcher_Created(object sender, FileSystemEventArgs e)
+ {
+ Console.WriteLine($"File '{e.Name}' created");
+
+ foreach (var device in Config.DeviceIds)
+ {
+ await Bot.Client.TelegramClient.SendTextMessageAsync(device, $"File '{e.Name}' created");
+ }
+ }
+
+ private static async void Watcher_Renamed(object sender, RenamedEventArgs e)
+ {
+ Console.WriteLine($"File '{e.Name}' renamed");
+
+ foreach (var device in Config.DeviceIds)
+ {
+ await Bot.Client.TelegramClient.SendTextMessageAsync(device, $"File '{e.Name}' renamed");
+ }
+ }
+ }
+}
diff --git a/TelegramBotBase.Extensions.Images.IronSoftware/ImageExtensions.cs b/TelegramBotBase.Extensions.Images.IronSoftware/ImageExtensions.cs
index bc067ee..17504bd 100644
--- a/TelegramBotBase.Extensions.Images.IronSoftware/ImageExtensions.cs
+++ b/TelegramBotBase.Extensions.Images.IronSoftware/ImageExtensions.cs
@@ -4,6 +4,7 @@
using System.Threading.Tasks;
using Telegram.Bot.Types;
using TelegramBotBase.Form;
+using TelegramBotBase.Interfaces;
using TelegramBotBase.Sessions;
using static IronSoftware.Drawing.AnyBitmap;
using SKImage = SixLabors.ImageSharp.Image;
@@ -37,7 +38,7 @@ public static async Task ToStream(this SKImage image)
///
///
///
- public static async Task SendPhoto(this DeviceSession session, AnyBitmap image, string name,
+ public static async Task SendPhoto(this IDeviceSession session, AnyBitmap image, string name,
string caption, ButtonForm buttons = null, int replyTo = 0,
bool disableNotification = false)
{
@@ -58,7 +59,7 @@ public static async Task SendPhoto(this DeviceSession session, AnyBitma
///
///
///
- public static async Task SendPhoto(this DeviceSession session, SKImage image, string name,
+ public static async Task SendPhoto(this IDeviceSession session, SKImage image, string name,
string caption, ButtonForm buttons = null, int replyTo = 0,
bool disableNotification = false)
{
diff --git a/TelegramBotBase.Extensions.Images.IronSoftware/TelegramBotBase.Extensions.Images.IronSoftware.csproj b/TelegramBotBase.Extensions.Images.IronSoftware/TelegramBotBase.Extensions.Images.IronSoftware.csproj
index 3f0707d..728071f 100644
--- a/TelegramBotBase.Extensions.Images.IronSoftware/TelegramBotBase.Extensions.Images.IronSoftware.csproj
+++ b/TelegramBotBase.Extensions.Images.IronSoftware/TelegramBotBase.Extensions.Images.IronSoftware.csproj
@@ -1,7 +1,7 @@
- netstandard2.0;netcoreapp3.1;net6
+ netcoreapp3.1;net6https://github.com/MajMcCloud/TelegramBotFramework/tree/development/TelegramBotBase.Extensions.Images.IronSoftwarehttps://github.com/MajMcCloud/TelegramBotFramework/tree/development/TelegramBotBase.Extensions.Images.IronSoftwareMIT
@@ -19,11 +19,14 @@
allruntime; build; native; contentfiles; analyzers; buildtransitive
-
+
+
+
+
diff --git a/TelegramBotBase.Extensions.Images/ImageExtensions.cs b/TelegramBotBase.Extensions.Images/ImageExtensions.cs
index e394c74..0de3e75 100644
--- a/TelegramBotBase.Extensions.Images/ImageExtensions.cs
+++ b/TelegramBotBase.Extensions.Images/ImageExtensions.cs
@@ -4,7 +4,7 @@
using System.Threading.Tasks;
using Telegram.Bot.Types;
using TelegramBotBase.Form;
-using TelegramBotBase.Sessions;
+using TelegramBotBase.Interfaces;
namespace TelegramBotBase.Extensions.Images
{
@@ -27,7 +27,7 @@ public static Stream ToStream(this Image image, ImageFormat format)
///
///
///
- public static async Task SendPhoto(this DeviceSession session, Image image, string name,
+ public static async Task SendPhoto(this IDeviceSession session, Image image, string name,
string caption, ButtonForm buttons = null, int replyTo = 0,
bool disableNotification = false)
{
@@ -48,7 +48,7 @@ public static async Task SendPhoto(this DeviceSession session, Image im
///
///
///
- public static async Task SendPhoto(this DeviceSession session, Bitmap image, string name,
+ public static async Task SendPhoto(this IDeviceSession session, Bitmap image, string name,
string caption, ButtonForm buttons = null, int replyTo = 0,
bool disableNotification = false)
{
diff --git a/TelegramBotBase.Extensions.Images/TelegramBotBase.Extensions.Images.csproj b/TelegramBotBase.Extensions.Images/TelegramBotBase.Extensions.Images.csproj
index 6eb1036..1877142 100644
--- a/TelegramBotBase.Extensions.Images/TelegramBotBase.Extensions.Images.csproj
+++ b/TelegramBotBase.Extensions.Images/TelegramBotBase.Extensions.Images.csproj
@@ -1,7 +1,7 @@
- netstandard2.0;netcoreapp3.1;net6
+ netcoreapp3.1;net6;net7;net8https://github.com/MajMcCloud/TelegramBotFramework/tree/development/TelegramBotBase.Extensions.Imageshttps://github.com/MajMcCloud/TelegramBotFramework/tree/development/TelegramBotBase.Extensions.ImagesMIT
@@ -21,11 +21,14 @@
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
+
+
+
diff --git a/TelegramBotBase.Extensions.Serializer.Legacy.NewtonsoftJson/BotBaseBuilderExtensions.cs b/TelegramBotBase.Extensions.Serializer.Legacy.NewtonsoftJson/BotBaseBuilderExtensions.cs
new file mode 100644
index 0000000..77db456
--- /dev/null
+++ b/TelegramBotBase.Extensions.Serializer.Legacy.NewtonsoftJson/BotBaseBuilderExtensions.cs
@@ -0,0 +1,41 @@
+using System;
+using System.IO;
+using TelegramBotBase.Builder;
+using TelegramBotBase.Builder.Interfaces;
+
+namespace TelegramBotBase.Extensions.Serializer.Legacy.NewtonsoftJson
+{
+ public static class BotBaseBuilderExtensions
+ {
+
+ ///
+ /// Using the complex version of .Net JSON, which can serialize all objects.
+ /// Saves in application directory.
+ ///
+ ///
+ ///
+ public static ILanguageSelectionStage UseNewtonsoftJson(this ISessionSerializationStage builder)
+ {
+ var path = Path.Combine(Directory.GetCurrentDirectory(), "states.json");
+
+ builder.UseNewtonsoftJson(path);
+
+ return builder as BotBaseBuilder;
+ }
+
+ ///
+ /// Using the complex version of .Net JSON, which can serialize all objects.
+ /// Saves in application directory.
+ ///
+ ///
+ ///
+ public static ILanguageSelectionStage UseNewtonsoftJson(this ISessionSerializationStage builder, String path)
+ {
+ var _stateMachine = new NewtonsoftJsonStateMachine(path);
+
+ builder.UseSerialization(_stateMachine);
+
+ return builder as BotBaseBuilder;
+ }
+ }
+}
\ No newline at end of file
diff --git a/TelegramBotBase.Extensions.Serializer.Legacy.NewtonsoftJson/NewtonsoftJsonStateMachine.cs b/TelegramBotBase.Extensions.Serializer.Legacy.NewtonsoftJson/NewtonsoftJsonStateMachine.cs
new file mode 100644
index 0000000..39a3a60
--- /dev/null
+++ b/TelegramBotBase.Extensions.Serializer.Legacy.NewtonsoftJson/NewtonsoftJsonStateMachine.cs
@@ -0,0 +1,94 @@
+using System;
+using System.Data;
+using System.IO;
+using Newtonsoft.Json;
+using TelegramBotBase.Args;
+using TelegramBotBase.Base;
+using TelegramBotBase.Form;
+using TelegramBotBase.Interfaces;
+
+namespace TelegramBotBase.Extensions.Serializer.Legacy.NewtonsoftJson
+{
+ ///
+ /// Is used for all complex data types. Use if other default machines are not working.
+ ///
+ public class NewtonsoftJsonStateMachine : IStateMachine
+ {
+ ///
+ /// Will initialize the state machine.
+ ///
+ /// Path of the file and name where to save the session details.
+ ///
+ /// Type of Form which will be saved instead of Form which has
+ /// attribute declared. Needs to be subclass of
+ /// .
+ ///
+ /// Declares of the file could be overwritten.
+ public NewtonsoftJsonStateMachine(string file, Type fallbackStateForm = null, bool overwrite = true)
+ {
+ FallbackStateForm = fallbackStateForm;
+
+ if (FallbackStateForm != null && !FallbackStateForm.IsSubclassOf(typeof(FormBase)))
+ {
+ throw new ArgumentException($"{nameof(FallbackStateForm)} is not a subclass of {nameof(FormBase)}");
+ }
+
+ FilePath = file ?? throw new ArgumentNullException(nameof(file));
+ Overwrite = overwrite;
+ }
+
+ public string FilePath { get; set; }
+
+ public bool Overwrite { get; set; }
+
+ public Type FallbackStateForm { get; }
+
+ public StateContainer LoadFormStates()
+ {
+ try
+ {
+ var content = File.ReadAllText(FilePath);
+
+ var sc = JsonConvert.DeserializeObject(content, new JsonSerializerSettings
+ {
+ TypeNameHandling = TypeNameHandling.All,
+ TypeNameAssemblyFormatHandling = TypeNameAssemblyFormatHandling.Simple
+ });
+
+ return sc;
+ }
+ catch
+ {
+ }
+
+ return new StateContainer();
+ }
+
+ public void SaveFormStates(SaveStatesEventArgs e)
+ {
+ if (File.Exists(FilePath))
+ {
+ if (!Overwrite)
+ {
+ throw new Exception("File exists already.");
+ }
+
+ File.Delete(FilePath);
+ }
+
+ try
+ {
+ var content = JsonConvert.SerializeObject(e.States, Formatting.Indented, new JsonSerializerSettings
+ {
+ TypeNameHandling = TypeNameHandling.All,
+ TypeNameAssemblyFormatHandling = TypeNameAssemblyFormatHandling.Simple
+ });
+
+ File.WriteAllText(FilePath, content);
+ }
+ catch
+ {
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/TelegramBotBase.Extensions.Serializer.Legacy.NewtonsoftJson/README.md b/TelegramBotBase.Extensions.Serializer.Legacy.NewtonsoftJson/README.md
new file mode 100644
index 0000000..23169e9
--- /dev/null
+++ b/TelegramBotBase.Extensions.Serializer.Legacy.NewtonsoftJson/README.md
@@ -0,0 +1,31 @@
+# TelegramBotBase.Extensions.Serializer.Legacy.NewtonsoftJson
+
+[![NuGet version (TelegramBotBase)](https://img.shields.io/nuget/v/TelegramBotBase.Extensions.Serializer.Legacy.NewtonsoftJson.svg?style=flat-square)](https://www.nuget.org/packages/TelegramBotBase.Extensions.Serializer.Legacy.NewtonsoftJson/)
+[![Telegram chat](https://img.shields.io/badge/Support_Chat-Telegram-blue.svg?style=flat-square)](https://www.t.me/tgbotbase)
+
+[![License](https://img.shields.io/github/license/MajMcCloud/telegrambotframework.svg?style=flat-square&maxAge=2592000&label=License)](https://raw.githubusercontent.com/MajMcCloud/TelegramBotFramework/master/LICENCE.md)
+[![Package Downloads](https://img.shields.io/nuget/dt/TelegramBotBase.Extensions.Serializer.Legacy.NewtonsoftJson.svg?style=flat-square&label=Package%20Downloads)](https://www.nuget.org/packages/TelegramBotBase.Extensions.Serializer.Legacy.NewtonsoftJson)
+
+
+### Legacy version to recover with old dependencies using Newtonsoft.Json for session serialization
+
+
+## How to use
+
+```csharp
+using TelegramBotBase.Extensions.Serializer.Legacy.NewtonsoftJson;
+
+
+var bot = BotBaseBuilder
+ .Create()
+ .WithAPIKey(APIKey)
+ .DefaultMessageLoop()
+ .WithStartForm()
+ .NoProxy()
+ .OnlyStart()
+ .UseNewtonsoftJson()
+ .UseEnglish()
+ .Build();
+
+bot.Start();
+```
diff --git a/TelegramBotBase.Extensions.Serializer.Legacy.NewtonsoftJson/TelegramBotBase.Extensions.Serializer.Legacy.NewtonsoftJson.csproj b/TelegramBotBase.Extensions.Serializer.Legacy.NewtonsoftJson/TelegramBotBase.Extensions.Serializer.Legacy.NewtonsoftJson.csproj
new file mode 100644
index 0000000..f647b56
--- /dev/null
+++ b/TelegramBotBase.Extensions.Serializer.Legacy.NewtonsoftJson/TelegramBotBase.Extensions.Serializer.Legacy.NewtonsoftJson.csproj
@@ -0,0 +1,27 @@
+
+
+
+ netstandard2.0;netcoreapp3.1;net6;net7;net8;net9
+ True
+ https://github.com/MajMcCloud/TelegramBotFramework
+ https://github.com/MajMcCloud/TelegramBotFramework
+ MIT
+ true
+ snupkg
+ 1.0.1
+ 1.0.1
+ 1.0.1
+ A session serializer for Newtonsoft Json.
+
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+
+
diff --git a/TelegramBotBase.SourceGenerators/Resources/Telegram.Bot.xml b/TelegramBotBase.SourceGenerators/Resources/Telegram.Bot.xml
new file mode 100644
index 0000000..f01809d
--- /dev/null
+++ b/TelegramBotBase.SourceGenerators/Resources/Telegram.Bot.xml
@@ -0,0 +1,15301 @@
+
+
+
+ Telegram.Bot
+
+
+
+
+ Provides data for MakingApiRequest event
+
+
+
+
+ Bot API Request
+
+
+
+
+ HTTP Request Message
+
+
+
+
+ Initialize an object
+
+
+
+
+
+
+ Provides data for ApiResponseReceived event
+
+
+
+
+ HTTP response received from API
+
+
+
+
+ Event arguments of this request
+
+
+
+
+ Initialize an object
+
+ HTTP response received from API
+ Event arguments of this request
+
+
+
+ Represents an API error
+
+
+
+
+ Gets the error code.
+
+
+
+
+ Contains information about why a request was unsuccessful.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The message that describes the error.
+
+
+
+ Initializes a new instance of the class.
+
+ The message.
+ The error code.
+
+
+
+ Initializes a new instance of the class.
+
+ The error message that explains the reason for the exception.
+
+ The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic)
+ if no inner exception is specified.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The message.
+ The error code.
+ The inner exception.
+
+
+
+ Initializes a new instance of the class
+
+ The message
+ The error code
+ Response parameters
+
+
+
+ Initializes a new instance of the class
+
+ The message
+ The error code
+ Response parameters
+ The inner exception
+
+
+
+ Represents failed API response
+
+
+
+
+ Gets the error message.
+
+
+
+
+ Gets the error code.
+
+
+
+
+ Contains information about why a request was unsuccessful.
+
+
+
+
+ Initializes an instance of
+
+ Error code
+ Error message
+ Information about why a request was unsuccessful
+
+
+
+ Default implementation of that always returns
+
+
+
+
+
+
+
+ Parses unsuccessful responses from Telegram Bot API to make specific exceptions
+
+
+
+
+ Parses HTTP response and constructs a specific exception out of it
+
+ ApiResponse with an error
+
+
+
+
+ Represents a request error
+
+
+
+
+ of the received response
+
+
+
+
+ Initializes a new instance of the class.
+
+ The message that describes the error.
+
+
+
+ Initializes a new instance of the class.
+
+
+ The error message that explains the reason for the exception.
+
+
+ The exception that is the cause of the current exception, or a null reference
+ (Nothing in Visual Basic) if no inner exception is specified.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ The error message that explains the reason for the exception.
+
+
+ of the received response
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ The error message that explains the reason for the exception.
+
+
+ of the received response
+
+
+ The exception that is the cause of the current exception, or a null reference
+ (Nothing in Visual Basic) if no inner exception is specified.
+
+
+
+
+ Extension Methods
+
+
+
+
+ Deserialize body from HttpContent into
+
+ instance
+
+ Type of the resulting object
+
+
+ Thrown when body in the response can not be deserialized into
+
+
+
+
+ Deserialized JSON in Stream into
+
+ with content
+ Type of the resulting object
+ Deserialized instance of or null
+
+
+
+ A client interface to use the Telegram Bot API
+
+
+
+
+ when the bot is using local Bot API server
+
+
+
+
+ Unique identifier for the bot from bot token. For example, for the bot token
+ "1234567:4TT8bAc8GHUspu3ERYn-KGcvsvGB9u_n4ddy", the bot id is "1234567".
+ Token format is not public API so this property is optional and may stop working
+ in the future if Telegram changes it's token format.
+
+
+
+
+ Timeout for requests
+
+
+
+
+ Instance of to parse errors from Bot API into
+
+
+ This property is not thread safe
+
+
+
+ Occurs before sending a request to API
+
+
+
+
+ Occurs after receiving the response to an API request
+
+
+
+
+ Send a request to Bot API
+
+ Type of expected result in the response object
+ API request object
+
+ Result of the API request
+
+
+
+ Test the API token
+
+
+ if token is valid
+
+
+
+ Use this method to download a file. Get by calling
+
+
+ Path to file on server
+ Destination stream to write file to
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation.
+
+ filePath is null, empty or too short
+ is null
+
+
+
+ Processes s and errors.
+ See for a simple implementation
+
+
+
+
+ Handles an
+
+
+ The instance of the bot receiving the
+
+ The to handle
+
+ The which will notify that method execution should be cancelled
+
+
+
+
+
+ Handles an
+
+
+ The instance of the bot receiving the
+
+ The to handle
+
+ The which will notify that method execution should be cancelled
+
+
+
+
+
+ Requests new s and processes them using provided instance
+
+
+
+
+ Starts receiving s invoking
+ for each .
+ This method will block if awaited.
+
+
+ The used for processing s
+
+
+ The with which you can stop receiving
+
+
+ A that will be completed when cancellation will be requested through
+
+
+
+
+
+ Options to configure getUpdates requests
+
+
+
+
+ Identifier of the first update to be returned. Will be ignored if
+ is set to .
+
+
+
+
+ Indicates which s are allowed to be received.
+ In case of null the previous setting will be used
+
+
+
+
+ Limits the number of updates to be retrieved. Values between 1-100 are accepted.
+ Defaults to 100 when is set to null.
+
+
+ Thrown when the value doesn't satisfies constraints
+
+
+
+
+ Indicates if all pending s should be thrown out before start
+ polling. If set to should be set to not
+ null, otherwise will effectively be set to
+ receive all s.
+
+
+
+
+ A very simple implementation
+
+
+
+
+ Constructs a new with the specified callback functions
+
+ The function to invoke when an update is received
+ The function to invoke when an error occurs
+
+
+
+
+
+
+
+
+
+ A simple > implementation that requests new updates and handles them sequentially
+
+
+
+
+ Constructs a new with the specified >
+ instance and optional
+
+ The used for making GetUpdates calls
+ Options used to configure getUpdates requests
+
+
+
+
+
+
+ Will attempt to throw the last update using offset set to -1.
+
+
+
+
+ Update ID of the last increased by 1 if there were any
+
+
+
+
+ Type used to store documentation for shared properties in request types, use it using
+ <inheritdoc cref="Telegram.Bot.Requests.Abstractions.Documentation.[PropertyName]"/> syntax
+
+
+
+
+ List of special entities that appear in the caption, which can be specified instead of
+
+
+
+
+
+ List of special entities that appear in message text, which can be specified instead of
+
+
+
+
+
+ Mode for parsing entities in the new caption. See
+ formatting
+ options for more details.
+
+
+
+
+ Identifier of the inline message
+
+
+
+
+ An inline keyboard
+
+
+
+
+ Additional interface options. An inline keyboard,
+ custom reply keyboard, instructions to
+ remove reply keyboard or to
+ force a reply from the user.
+
+
+
+
+ Sends the message silently. Users will receive a notification with no sound.
+
+
+
+
+ If the message is a reply, ID of the original message
+
+
+
+
+ Pass , if the message should be sent even if the specified replied-to message is not found
+
+
+
+
+ Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported
+ server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's
+ width and height should not exceed 320. Ignored if the file is not uploaded using
+ multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so
+ you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using
+ multipart/form-data under <file_attach_name>
+
+
+
+
+ Protects the contents of sent messages from forwarding and saving
+
+
+
+
+ Represents a request having parameter
+
+
+
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+
+
+ Represents a request to Bot API
+
+
+
+
+ HTTP method of request
+
+
+
+
+ API method name
+
+
+
+
+ Allows this object to be used as a response in webhooks
+
+
+
+
+ Generate content of HTTP message
+
+ Content of HTTP request
+
+
+
+ Represents a request to Bot API
+
+ Type of result expected in result
+
+
+
+ Represents a request having parameter
+
+
+
+
+ User identifier
+
+
+
+
+ Use this method to send answers to callback queries sent from
+ inline keyboards. The answer will be
+ displayed to the user as a notification at the top of the chat screen or as an alert. On success,
+ is returned.
+
+
+ Alternatively, the user can be redirected to the specified Game URL.For this option to work, you
+ must first create a game for your bot via @Botfather and accept the terms. Otherwise, you
+ may use links like t.me/your_bot? start = XXXX that open your bot with a parameter.
+
+
+
+
+ Unique identifier for the query to be answered
+
+
+
+
+ Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters
+
+
+
+
+ If true, an alert will be shown by the client instead of a notification at the top of
+ the chat screen. Defaults to
+
+
+
+
+ URL that will be opened by the user's client. If you have created a
+ Game and accepted the conditions
+ via @Botfather, specify the URL that opens your game — note that this will only work
+ if the query comes from a callback_game button.
+
+ Otherwise, you may use links like t.me/your_bot? start = XXXX that open your bot with
+ a parameter
+
+
+
+
+
+ The maximum amount of time in seconds that the result of the callback query may be cached
+ client-side. Telegram apps will support caching starting in version 3.14. Defaults to 0
+
+
+
+
+ Initializes a new request with callbackQueryId
+
+ Unique identifier for the query to be answered
+
+
+
+ Use this method to delete the list of the bot’s commands for the given
+ scope and user language. After deletion,
+ higher level commands
+ will be shown to affected users. Returns on success.
+
+
+
+
+ An object, describing scope of users for which the commands are relevant.
+ Defaults to .
+
+
+
+
+ A two-letter ISO 639-1 language code. If empty, commands will be applied to all users
+ from the given Scope, for whose language there are no dedicated
+ commands
+
+
+
+
+ Initializes a new request
+
+
+
+
+ Use this method to get the current list of the bot’s commands for the given scope
+ and user language. Returns Array of on success.
+ If commands aren't set, an empty list is returned.
+
+
+
+
+ An object, describing scope of users. Defaults to .
+
+
+
+
+ A two-letter ISO 639-1 language code or an empty string
+
+
+
+
+ Initializes a new request
+
+
+
+
+ Use this method to change the list of the bot’s commands. See
+ for more details about bot commands.
+ Returns on success
+
+
+
+
+ A list of bot commands to be set as the list of the bot’s commands.
+ At most 100 commands can be specified.
+
+
+
+
+ An object, describing scope of users for which the commands are relevant.
+ Defaults to .
+
+
+
+
+ A two-letter ISO 639-1 language code. If empty, commands will be applied to all users
+ from the given , for whose language there are no dedicated commands
+
+
+
+
+ Initializes a new request with commands
+
+ A list of bot commands to be set
+
+
+
+ Use this method to get the current bot description
+ for the given user language.
+ Returns on success.
+
+
+
+
+ A two-letter ISO 639-1 language code or an empty string
+
+
+
+
+ Initializes a new request
+
+
+
+
+ Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty.
+ Returns on success.
+
+
+
+
+ New bot description; 0-512 characters. Pass an empty string to remove the
+ dedicated description for the given language.
+
+
+
+
+ A two-letter ISO 639-1 language code. If empty, the description will be applied
+ to all users for whose language there is no dedicated description.
+
+
+
+
+ Initializes a new request
+
+
+
+
+ Use this method to get basic info about a file and prepare it for downloading. For the moment,
+ bots can download files of up to 20MB in size. On success, a object is
+ returned. The file can then be downloaded via the link
+ https://api.telegram.org/file/bot<token>/<file_path>, where
+ <file_path> is taken from the response. It is guaranteed that the link will be valid
+ for at least 1 hour. When the link expires, a new one can be requested by calling
+ again.
+
+
+ You can use or
+ methods to download the file
+
+
+
+
+ File identifier to get info about
+
+
+
+
+ Initializes a new request with
+
+ File identifier to get info about
+
+
+
+ Use this method to get a list of profile pictures for a user. Returns a
+ object.
+
+
+
+
+
+
+
+ Sequential number of the first photo to be returned. By default, all photos are returned
+
+
+
+
+ Limits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100
+
+
+
+
+ Initializes a new request with userId
+
+ Unique identifier of the target user
+
+
+
+ Use this method to get the current value of the bot’s menu button in a private chat, or the default menu button.
+ Returns on success.
+
+
+
+
+ Optional. Unique identifier for the target private chat. If not specified, default bot’s menu button
+ will be changed
+
+
+
+
+ Initializes a new request
+
+
+
+
+ A simple method for testing your bot’s auth token. Requires no parameters. Returns basic information
+ about the bot in form of a object.
+
+
+
+
+ Initializes a new request
+
+
+
+
+ Use this method to get the current default administrator rights of the bot.
+ Returns on success.
+
+
+
+
+ Pass to get default administrator rights of the bot in channels. Otherwise, default administrator
+ rights of the bot for groups and supergroups will be returned.
+
+
+
+
+ Initializes a new request
+
+
+
+
+ Use this method to get the current bot name for the given user language.
+ Returns on success.
+
+
+
+
+ A two-letter ISO 639-1 language code or an empty string
+
+
+
+
+ Initializes a new request
+
+
+
+
+ Use this method to close the bot instance before moving it from one local server to another.
+ You need to delete the webhook before calling this method to ensure that the bot isn't launched
+ again after server restart. The method will return error 429 in the first 10 minutes after the
+ bot is launched. Returns on success. Requires no parameters.
+
+
+
+
+
+ Initializes a new request
+
+
+
+
+ Use this method to log out from the cloud Bot API server before launching the bot locally.
+ You must log out the bot before running it locally, otherwise there is no guarantee
+ that the bot will receive updates. After a successful call, you can immediately log in on
+ a local server, but will not be able to log in back to the cloud Bot API server for 10
+ minutes. Returns on success. Requires no parameters.
+
+
+
+
+
+ Initializes a new request
+
+
+
+
+ Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups
+ and channels, the user will not be able to return to the chat on their own using invite links,
+ etc., unless unbanned first. The bot must be an
+ administrator in the chat for this to work and must have the appropriate admin rights.
+ Returns on success.
+
+
+
+
+
+
+
+
+
+
+ Date when the user will be unbanned. If user is banned for more than 366 days or less
+ than 30 seconds from the current time they are considered to be banned forever.
+ Applied for supergroups and channels only.
+
+
+
+
+ Pass to delete all messages from the chat for the user that is being removed. If
+ , the user will be able to see messages in the group that were sent before
+ the user was removed. Always for supergroups and channels.
+
+
+
+
+ Initializes a new request with chatId and userId
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Unique identifier of the target user
+
+
+
+ Use this request to ban a channel chat in a supergroup or a channel. The owner of the chat will not be able
+ to send messages and join live streams on behalf of the chat, unless it is unbanned first. The bot must be
+ an administrator in the supergroup or channel for this to work and must have the appropriate administrator
+ rights. Returns on success
+
+
+
+
+
+
+
+ Unique identifier of the target sender chat
+
+
+
+
+ Date when the sender chat will be unbanned, unix time. If the chat is banned for more than 366 days or
+ less than 30 seconds from the current time they are considered to be banned forever.
+
+
+
+
+ Initializes a new request with chatId and senderChatId
+
+
+ Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+
+
+ Unique identifier of the target sender chat
+
+
+
+
+ Use this request to approve a chat join request. The bot must be an administrator in the chat for this to
+ work and must have the administrator right.
+ Returns on success.
+
+
+
+
+
+
+
+ Unique identifier of the target user
+
+
+
+
+ Initializes a new request with chatId and userId
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Unique identifier of the target user
+
+
+
+ Use this method to create an additional invite link for a chat. The bot must be an
+ administrator in the chat for this to work and must have the appropriate admin rights.
+ The link can be revoked using the method .
+ Returns the new invite link as object.
+
+
+
+
+
+
+
+ Invite link name; 0-32 characters
+
+
+
+
+ Point in time when the link will expire
+
+
+
+
+ Maximum number of users that can be members of the chat simultaneously after joining the
+ chat via this invite link; 1-99999
+
+
+
+
+ Set to , if users joining the chat via the link need to be approved by chat administrators.
+ If , can't be specified
+
+
+
+
+ Initializes a new request with chatId
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+
+
+ Use this request to decline a chat join request. The bot must be an administrator in the chat for this to
+ work and must have the administrator right.
+ Returns on success.
+
+
+
+
+
+
+
+ Unique identifier of the target user
+
+
+
+
+ Initializes a new request with chatId and userId
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Unique identifier of the target user
+
+
+
+ Use this method to edit a non-primary invite link created by the bot. The bot must be an administrator
+ in the chat for this to work and must have the appropriate admin rights. Returns the edited invite
+ link as a object.
+
+
+
+
+
+
+
+ The invite link to edit
+
+
+
+
+ Invite link name; 0-32 characters
+
+
+
+
+ Point in time when the link will expire
+
+
+
+
+ Maximum number of users that can be members of the chat simultaneously after joining the
+ chat via this invite link; 1-99999
+
+
+
+
+ Set to , if users joining the chat via the link need to be approved by chat administrators.
+ If , can't be specified
+
+
+
+
+ Initializes a new request with chatId and inviteLink
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ The invite link to edit
+
+
+
+ Use this method to generate a new primary invite link for a chat; any previously generated primary
+ link is revoked. The bot must be an administrator in the chat for this to work and must have the
+ appropriate admin rights. Returns the new invite link as string on success.
+
+
+
+
+
+
+
+ Initializes a new request with chatId
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+
+
+ Use this method to revoke an invite link created by the bot. If the primary link is revoked, a new
+ link is automatically generated. The bot must be an administrator in the chat for this to work and
+ must have the appropriate admin rights. Returns the revoked invite link as
+ object.
+
+
+
+
+
+
+
+ The invite link to revoke
+
+
+
+
+ Initializes a new request with chatId and inviteLink
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ The invite link to revoke
+
+
+
+ Use this request to close an open topic in a forum supergroup chat. The bot must be an administrator in the chat
+ for this to work and must have the administrator rights,
+ unless it is the creator of the topic. Returns on success.
+
+
+
+
+
+
+
+ Unique identifier for the target message thread of the forum topic
+
+
+
+
+ Initializes a new request
+
+ Unique identifier for the target chat or username of the target supergroup
+ Unique identifier for the target message thread of the forum topic
+
+
+
+ Use this request to close an open 'General' topic in a forum supergroup chat. The bot must be an administrator in
+ the chat for this to work and must have the administrator
+ rights. Returns on success.
+
+
+
+
+
+
+
+ Initializes a new request
+
+ Unique identifier for the target chat or username of the target supergroup
+
+
+
+ Use this request to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for
+ this to work and must have the administrator rights.
+ Returns information about the created topic as a object.
+
+
+
+
+
+
+
+ Topic name, 1-128 characters
+
+
+
+
+ Optional. Color of the topic icon in RGB format. Currently, must be one of 0x6FB9F0, 0xFFD67E, 0xCB86DB,
+ 0x8EEE98, 0xFF93B2, or 0xFB6F5F
+
+
+
+
+ Optional. Unique identifier of the custom emoji shown as the topic icon.
+
+
+
+
+ Initializes a new request
+
+ Unique identifier for the target chat or username of the target supergroup
+ Topic name
+
+
+
+ Use this method to delete a chat photo. Photos can't be changed for private chats. The bot
+ must be an administrator in the chat for this to work and must have the appropriate
+ admin rights. Returns on success.
+
+
+
+
+
+
+
+ Initializes a new request with chatId
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+
+
+ Use this method to delete a group sticker set from a supergroup. The bot must be an administrator
+ in the chat for this to work and must have the appropriate admin rights. Use the field
+ optionally returned in
+ requests to check if the bot can use this method. Returns on success.
+
+
+
+
+
+
+
+ Initializes a new request with chatId
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+
+
+ Use this request to delete an open topic in a forum supergroup chat. The bot must be an administrator in the chat
+ for this to work and must have the administrator rights,
+ unless it is the creator of the topic. Returns on success.
+
+
+
+
+
+
+
+ Unique identifier for the target message thread of the forum topic
+
+
+
+
+ Initializes a new request
+
+ Unique identifier for the target chat or username of the target supergroup
+ Unique identifier for the target message thread of the forum topic
+
+
+
+ Use this request to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator
+ in the chat for this to work and must have administrator
+ rights, unless it is the creator of the topic. Returns on success.
+
+
+
+
+
+
+
+ Unique identifier for the target message thread of the forum topic
+
+
+
+
+ New topic name, 0-128 characters. If not specififed or empty, the current name of the topic will be kept
+
+
+
+
+ New unique identifier of the custom emoji shown as the topic icon. Use
+ to get all allowed custom emoji identifiers. Pass an empty string to remove the icon.
+ If not specified, the current icon will be kept
+
+
+
+
+ Initializes a new request
+
+ Unique identifier for the target chat or username of the target supergroup
+ Unique identifier for the target message thread of the forum topic
+
+
+
+ Use this request to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an
+ administrator in the chat for this to work and must have
+ administrator rights. Returns on success.
+
+
+
+
+
+
+
+ New topic name, 1-128 characters
+
+
+
+
+ Initializes a new request
+
+ Unique identifier for the target chat or username of the target supergroup
+ New topic name, 1-128 characters
+
+
+
+ Use this method to get a list of administrators in a chat. On success, returns an Array of
+ objects that contains information about all chat administrators
+ except other bots. If the chat is a group or a supergroup and no administrators were appointed,
+ only the creator will be returned.
+
+
+
+
+
+
+
+ Initializes a new request with chatId
+
+
+ Unique identifier for the target chat or username of the target supergroup or channel
+ (in the format @channelusername)
+
+
+
+
+ Use this method to get the number of members in a chat. Returns int on success.
+
+
+
+
+
+
+
+ Initializes a new request with chatId
+
+
+ Unique identifier for the target chat or username of the target supergroup or channel
+ (in the format @channelusername)
+
+
+
+
+ Use this method to get information about a member of a chat. Returns a
+ object on success.
+
+
+
+
+
+
+
+
+
+
+ Initializes a new request with chatId and userId
+
+
+ Unique identifier for the target chat or username of the target supergroup or channel
+ (in the format @channelusername)
+
+ Unique identifier of the target user
+
+
+
+ Use this method to get up to date information about the chat (current name of the user for
+ one-on-one conversations, current username of a user, group or channel, etc.).
+ Returns a object on success.
+
+
+
+
+
+
+
+ Initializes a new request with chatId
+
+
+ Unique identifier for the target chat or username of the target supergroup or channel
+ (in the format @channelusername)
+
+
+
+
+ Use this method to hide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the
+ chat for this to work and must have the administrator rights.
+ The topic will be automatically closed if it was open. Returns on success.
+
+
+
+
+
+
+
+ Initializes a new request
+
+ Unique identifier for the target chat or username of the target supergroup
+
+
+
+ Use this method for your bot to leave a group, supergroup or channel. Returns on success.
+
+
+
+
+
+
+
+ Initializes a new request with chatId
+
+
+ Unique identifier for the target chat or username of the target supergroup or channel
+ (in the format @channelusername)
+
+
+
+
+ Use this method to add a message to the list of pinned messages in a chat. If the chat is not a
+ private chat, the bot must be an administrator in the chat for this to work and must have the
+ '' admin right in a supergroup or
+ '' admin right in a channel.
+ Returns on success.
+
+
+
+
+
+
+
+ Identifier of a message to pin
+
+
+
+
+
+
+
+ Initializes a new request with chatId and messageId
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Identifier of a message to pin
+
+
+
+ Use this method to promote or demote a user in a supergroup or a channel. The bot must be
+ an administrator in the chat for this to work and must have the appropriate admin rights.
+ Pass for all boolean parameters to demote a user. Returns on success.
+
+
+
+
+
+
+
+
+
+
+ Pass , if the administrator's presence in the chat is hidden
+
+
+
+
+ Pass , if the administrator can access the chat event log, chat statistics, message
+ statistics in channels, see channel members, see anonymous administrators in supergroups
+ and ignore slow mode. Implied by any other administrator privilege
+
+
+
+
+ Pass , if the administrator can create channel posts, channels only
+
+
+
+
+ Pass , if the administrator can edit messages of other users and can pin messages,
+ channels only
+
+
+
+
+ Pass , if the administrator can delete messages of other users
+
+
+
+
+ Pass , if the administrator can manage video chats
+
+
+
+
+ Pass , if the administrator can restrict, ban or unban chat members
+
+
+
+
+ Pass , if the administrator can add new administrators with a subset of their own
+ privileges or demote administrators that he has promoted, directly or indirectly
+ (promoted by administrators that were appointed by him)
+
+
+
+
+ Pass , if the administrator can change chat title, photo and other settings
+
+
+
+
+ Pass , if the administrator can invite new users to the chat
+
+
+
+
+ Pass , if the administrator can pin messages, supergroups only
+
+
+
+
+ Pass if the user is allowed to create, rename, close, and reopen forum topics, supergroups only
+
+
+
+
+ Initializes a new request with chatId and userId
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Unique identifier of the target user
+
+
+
+ Use this request to reopen an open topic in a forum supergroup chat. The bot must be an administrator in the chat
+ for this to work and must have the administrator rights,
+ unless it is the creator of the topic. Returns on success.
+
+
+
+
+
+
+
+ Unique identifier for the target message thread of the forum topic
+
+
+
+
+ Initializes a new request
+
+ Unique identifier for the target chat or username of the target supergroup
+ Unique identifier for the target message thread of the forum topic
+
+
+
+ Use this request to reopen a closed 'General' topic in a forum supergroup chat. The bot must be an administrator
+ in the chat for this to work and must have the administrator
+ rights. The topic will be automatically unhidden if it was hidden. Returns on success.
+
+
+
+
+
+
+
+ Initializes a new request
+
+ Unique identifier for the target chat or username of the target supergroup
+
+
+
+ Use this method to restrict a user in a supergroup. The bot must be an administrator in the
+ supergroup for this to work and must have the appropriate admin rights. Pass
+ for all permissions to lift restrictions from a user. Returns on success.
+
+
+
+
+
+
+
+
+
+
+ New user permissions
+
+
+
+
+ Pass if chat permissions are set independently. Otherwise, the
+ , and
+ permissions will imply the ,
+ , ,
+ , ,
+ , and
+ permissions; the permission will imply the
+ permission.
+
+
+
+
+ Date when restrictions will be lifted for the user, unix time. If user is restricted for
+ more than 366 days or less than 30 seconds from the current time, they are considered to
+ be restricted forever.
+
+
+
+
+ Initializes a new request with chatId, userId and new user permissions
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Unique identifier of the target user
+ New user permissions
+
+
+
+ Use this method to set a custom title for an administrator in a supergroup promoted by the bot.
+ Returns on success.
+
+
+
+
+
+
+
+
+
+
+ New custom title for the administrator; 0-16 characters, emoji are not allowed
+
+
+
+
+ Initializes a new request with chatId, userId and customTitle
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Unique identifier of the target user
+
+ New custom title for the administrator; 0-16 characters, emoji are not allowed
+
+
+
+
+ Use this method to change the description of a group, a supergroup or a channel.
+ The bot must be an administrator in the chat for this to work and must have the
+ appropriate admin rights. Returns on success.
+
+
+
+
+
+
+
+ New chat Description, 0-255 characters
+
+
+
+
+ Initializes a new request with chatId
+
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+
+
+ Use this method to set default chat permissions for all members. The bot must be an administrator
+ in the group or a supergroup for this to work and must have the can_restrict_members admin rights.
+ Returns on success.
+
+
+
+
+
+
+
+ New default chat permissions
+
+
+
+
+ Pass if chat permissions are set independently. Otherwise, the
+ , and
+ permissions will imply the ,
+ , ,
+ , ,
+ , and
+ permissions; the permission will imply the
+ permission.
+
+
+
+
+ Initializes a new request with chatId and new default permissions
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ New default chat permissions
+
+
+
+ Use this method to set a new profile photo for the chat. Photos can't be changed for private
+ chats. The bot must be an administrator in the chat for this to work and must have the appropriate
+ admin rights. Returns on success.
+
+
+
+
+
+
+
+ New chat photo, uploaded using multipart/form-data
+
+
+
+
+ Initializes a new request with chatId and photo
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ New chat photo, uploaded using multipart/form-data
+
+
+
+
+
+
+ Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in
+ the chat for this to work and must have the appropriate admin rights. Use the field
+ optionally returned in requests to
+ check if the bot can use this method. Returns on success.
+
+
+
+
+
+
+
+ Name of the sticker set to be set as the group sticker set
+
+
+
+
+ Initializes a new request with chatId and new stickerSetName
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Name of the sticker set to be set as the group sticker set
+
+
+
+ Use this method to change the title of a chat. Titles can't be changed for private chats.
+ The bot must be an administrator in the chat for this to work and must have the appropriate
+ admin rights. Returns on success.
+
+
+
+
+
+
+
+ New chat title, 1-255 characters
+
+
+
+
+ Initializes a new request with chatId and title
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ New chat title, 1-255 characters
+
+
+
+ Use this method to unban a previously banned user in a supergroup or channel. The user will
+ not return to the group or channel automatically, but will be able to join via link,
+ etc. The bot must be an administrator for this to work. By default, this method guarantees
+ that after the call the user is not a member of the chat, but will be able to join it.
+ So if the user is a member of the chat they will also be removed from the chat.
+ If you don't want this, use the parameter . Returns on success.
+
+
+
+
+
+
+
+
+
+
+ Do nothing if the user is not banned
+
+
+
+
+ Initializes a new request with chatId and userId
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Unique identifier of the target user
+
+
+
+ Use this request to unban a previously banned channel chat in a supergroup or channel. The bot must be an
+ administrator for this to work and must have the appropriate administrator rights. Returns
+ on success
+
+
+
+
+
+
+
+ Unique identifier of the target sender chat
+
+
+
+
+ Initializes a new request with chatId and senderChatId
+
+
+ Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+
+
+ Unique identifier of the target sender chat
+
+
+
+
+ Use this method to uhhide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the
+ chat for this to work and must have the administrator rights.
+ Returns on success.
+
+
+
+
+
+
+
+ Initializes a new request
+
+ Unique identifier for the target chat or username of the target supergroup
+
+
+
+ Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat,
+ the bot must be an administrator in the chat for this to work and must have the
+ '' admin right in a supergroup or
+ '' admin right in a channel.
+ Returns on success.
+
+
+
+
+
+
+
+ Initializes a new request with chatId
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+
+
+ Use this request to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat
+ for this to work and must have the administrator rights,
+ unless it is the creator of the topic. Returns on success.
+
+
+
+
+
+
+
+ Unique identifier for the target message thread of the forum topic
+
+
+
+
+ Initializes a new request
+
+ Unique identifier for the target chat or username of the target supergroup
+ Unique identifier for the target message thread of the forum topic
+
+
+
+ Use this method to remove a message from the list of pinned messages in a chat. If the chat is not
+ a private chat, the bot must be an administrator in the chat for this to work and must have the
+ '' admin right in a supergroup or
+ '' admin right in a channel.
+ Returns on success.
+
+
+
+
+
+
+
+ Identifier of a message to unpin. If not specified, the most recent pinned message
+ (by sending date) will be unpinned.
+
+
+
+
+ Initializes a new request with chatId
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+
+
+ Use this method to copy messages of any kind. Service messages and invoice messages can't be copied.
+ The method is analogous to the method , but the copied message
+ doesn't have a link to the original message. Returns the of the
+ sent on success.
+
+
+
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+
+
+
+ Unique identifier for the chat where the original message was sent
+ (or channel username in the format @channelusername)
+
+
+
+
+ Message identifier in the chat specified in
+
+
+
+
+ New caption for media, 0-1024 characters after entities parsing.
+ If not specified, the original caption is kept
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new request with chatId, fromChatId and messageId
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+ Unique identifier for the chat where the original message was sent
+ (or channel username in the format @channelusername)
+
+
+ Message identifier in the chat specified in
+
+
+
+
+ Use this method to forward messages of any kind. Service messages can't be forwarded. On success, the sent is returned.
+
+
+
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+
+
+
+ Unique identifier for the chat where the original message was sent
+ (or channel username in the format @channelusername)
+
+
+
+
+ Message identifier in the chat specified in
+
+
+
+
+
+
+
+
+
+
+ Initializes a new request with chatId, fromChatId and messageId
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+ Unique identifier for the chat where the original message was sent
+ (or channel username in the format @channelusername)
+
+
+ Message identifier in the chat specified in
+
+
+
+
+ Use this method to edit live location messages. A location can be edited until its
+ expires or editing is explicitly disabled by a call to
+ . On success is returned.
+
+
+
+
+
+
+
+ Latitude of new location
+
+
+
+
+ Longitude of new location
+
+
+
+
+ The radius of uncertainty for the location, measured in meters; 0-1500
+
+
+
+
+ Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
+
+
+
+
+ Maximum distance for proximity alerts about approaching another chat member, in meters. Must be
+ between 1 and 100000 if specified.
+
+
+
+
+
+
+
+ Initializes a new request with inlineMessageId, latitude and longitude
+
+ Identifier of the inline message
+ Latitude of new location
+ Longitude of new location
+
+
+
+ Use this method to edit live location messages. A location can be edited until its
+ expires or editing is explicitly disabled by a call to
+ . On success the edited is returned.
+
+
+
+
+
+
+
+ Identifier of the message to edit
+
+
+
+
+ Latitude of new location
+
+
+
+
+ Longitude of new location
+
+
+
+
+ The radius of uncertainty for the location, measured in meters; 0-1500
+
+
+
+
+ Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
+
+
+
+
+ Maximum distance for proximity alerts about approaching another chat member, in meters.
+ Must be between 1 and 100000 if specified.
+
+
+
+
+
+
+
+ Initializes a new request with chatId, messageId, latitude and longitude
+
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Identifier of the message to edit
+ Latitude of new location
+ Longitude of new location
+
+
+
+ Use this method to send point on the map. On success, the sent is returned.
+
+
+
+
+
+
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+
+
+
+ Latitude of the location
+
+
+
+
+ Longitude of the location
+
+
+
+
+ Period in seconds for which the location will be updated, should be between 60 and 86400
+
+
+
+
+ For live locations, a direction in which the user is moving, in degrees.
+ Must be between 1 and 360 if specified.
+
+
+
+
+ For live locations, a maximum distance for proximity alerts about approaching another
+ chat member, in meters. Must be between 1 and 100000 if specified.
+
+
+
+
+ Sends the message silently. Users will receive a notification with no sound.
+
+
+
+
+
+
+
+ If the message is a reply, ID of the original message
+
+
+
+
+ Pass , if the message should be sent even if the specified replied-to message is not found
+
+
+
+
+
+
+
+ Initializes a new request with chatId, latitude and longitude
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Latitude of the location
+ Longitude of the location
+
+
+
+ Use this method to send information about a venue. On success, the sent is returned.
+
+
+
+
+
+
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+
+
+
+ Latitude of the venue
+
+
+
+
+ Longitude of the venue
+
+
+
+
+ Name of the venue
+
+
+
+
+ Address of the venue
+
+
+
+
+ Foursquare identifier of the venue
+
+
+
+
+ Foursquare type of the venue, if known. (For example, “arts_entertainment/default”,
+ “arts_entertainment/aquarium” or “food/icecream”.)
+
+
+
+
+ Google Places identifier of the venue
+
+
+
+
+ Google Places type of the venue.
+ (See supported types.)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new request with chatId, location, venue title and address
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Latitude of the venue
+ Longitude of the venue
+ Name of the venue
+ Address of the venue
+
+
+
+ Use this method to stop updating a live location message before expires.
+ On success is returned.
+
+
+
+
+
+
+
+
+
+
+ Initializes a new request with inlineMessageId
+
+ Identifier of the inline message
+
+
+
+ Use this method to stop updating a live location message before
+ expires. On success the sent
+ is returned.
+
+
+
+
+
+
+
+ Identifier of the sent message
+
+
+
+
+
+
+
+ Initializes a new request with chatId and messageId
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Identifier of the sent message
+
+
+
+ Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success,
+ the sent is returned. Bots can currently send animation files of up to
+ 50 MB in size, this limit may be changed in the future.
+
+
+
+
+
+
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+
+
+
+ Animation to send. Pass a as String to send an animation
+ that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram
+ to get an animation from the Internet, or upload a new animation using multipart/form-data
+
+
+
+
+ Duration of sent animation in seconds
+
+
+
+
+ Animation width
+
+
+
+
+ Animation height
+
+
+
+
+
+
+
+ Animation caption (may also be used when resending animation by
+ ), 0-1024 characters after entities parsing
+
+
+
+
+
+
+
+
+
+
+ Pass if the photo needs to be covered with a spoiler animation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new request with chatId and animation
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+ Animation to send. Pass a as String to send an animation
+ that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to
+ get an animation from the Internet, or upload a new animation using multipart/form-data
+
+
+
+
+
+
+
+ Use this method to send audio files, if you want Telegram clients to display them in the music
+ player. Your audio must be in the .MP3 or .M4A format. On success, the sent
+ is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be
+ changed in the future.
+
+
+
+
+
+
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+
+
+
+ Audio file to send. Pass a as String to send an audio
+ file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for
+ Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data
+
+
+
+
+ Audio caption, 0-1024 characters after entities parsing
+
+
+
+
+
+
+
+
+
+
+ Duration of the audio in seconds
+
+
+
+
+ Performer
+
+
+
+
+ Track name
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new request with chatId and audio
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+ Audio file to send. Pass a as String to send an audio
+ file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for
+ Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data
+
+
+
+
+
+
+
+ Use this request when you need to tell the user that something is happening on the bot’s side.
+ The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients
+ clear its typing status). Returns on success.
+
+
+ Example: The ImageBot needs some time to process a request
+ and upload the image. Instead of sending a text message along the lines of “Retrieving image,
+ please wait…”, the bot may use with
+ = . The user will see a “sending photo”
+ status for the bot.
+
+ We only recommend using this method when a response from the bot will take a noticeable
+ amount of time to arrive.
+
+
+
+
+
+
+
+
+ Unique identifier for the target message thread; supergroups only
+
+
+
+
+ Type of action to broadcast. Choose one, depending on what the user is about to receive:
+ for text messages,
+ for photos,
+ or for
+ videos, or
+ for voice notes,
+ for general files,
+ for location data,
+ or for
+ video notes
+
+
+
+
+ Initializes a new request chatId and action
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+ Type of action to broadcast. Choose one, depending on what the user is about to receive
+
+
+
+
+ Use this method to send phone contacts. On success, the sent is returned.
+
+
+
+
+
+
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+
+
+
+ Contact's phone number
+
+
+
+
+ Contact's first name
+
+
+
+
+ Contact's last name
+
+
+
+
+ Additional data about the contact in the form of a vCard, 0-2048 bytes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new request with chatId, phoneNumber and firstName
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Contact's phone number
+ Contact's first name
+
+
+
+ Use this method to send an animated emoji that will display a random value. On success,
+ the sent is returned.
+
+
+
+
+
+
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+
+
+
+ Emoji on which the dice throw animation is based. Defaults to
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new request with chatId
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+
+ Use this method to send general files. On success, the sent
+ is returned. Bots can currently send files of any type of up to 50 MB in size,
+ this limit may be changed in the future.
+
+
+
+
+
+
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+
+
+
+ File to send. Pass a as String to send a file that
+ exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram
+ to get a file from the Internet, or upload a new one using multipart/form-data
+
+
+
+
+
+
+
+ Document caption (may also be used when resending documents by file_id), 0-1024 characters
+ after entities parsing
+
+
+
+
+
+
+
+
+
+
+ Disables automatic server-side content type detection for files uploaded using multipart/form-data
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new request with chatId and document
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+ File to send. Pass a as string to send a file that
+ exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram
+ to get a file from the Internet, or upload a new one using multipart/form-data
+
+
+
+
+
+
+
+ Use this method to send a group of photos, videos, documents or audios as an album. Documents and
+ audio files can be only grouped in an album with messages of the same type. On success, an array
+ of s that were sent is returned.
+
+
+
+
+
+
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+
+
+
+ An array describing messages to be sent, must include 2-10 items
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a request with chatId and media
+
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ An array describing messages to be sent, must include 2-10 items
+
+
+
+
+
+
+ Use this method to send text messages. On success, the sent is returned.
+
+
+
+
+
+
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+
+
+
+ Text of the message to be sent, 1-4096 characters after entities parsing
+
+
+
+
+
+
+
+
+
+
+ Disables link previews for links in this message
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new request with chatId and text
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Text of the message to be sent, 1-4096 characters after entities parsing
+
+
+
+ Use this method to send photos. On success, the sent is returned.
+
+
+
+
+
+
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+
+
+
+ Photo to send. Pass a as String to send a photo that
+ exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to
+ get a photo from the Internet, or upload a new photo using multipart/form-data. The photo
+ must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total.
+ Width and height ratio must be at most 20
+
+
+
+
+ Photo caption (may also be used when resending photos by ),
+ 0-1024 characters after entities parsing
+
+
+
+
+
+
+
+
+
+
+ Pass if the photo needs to be covered with a spoiler animation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new request with chatId and photo
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+ Photo to send. Pass a as String to send a photo that
+ exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to
+ get a photo from the Internet, or upload a new photo using multipart/form-data. The photo
+ must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total.
+ Width and height ratio must be at most 20
+
+
+
+
+
+
+ Use this method to send a native poll. On success, the sent is returned.
+
+
+
+
+
+
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+
+
+
+ Poll question, 1-300 characters
+
+
+
+
+ A list of answer options, 2-10 strings 1-100 characters each
+
+
+
+
+ , if the poll needs to be anonymous, defaults to
+
+
+
+
+ Poll type, defaults to
+
+
+
+
+ , if the poll allows multiple answers, ignored for polls in quiz mode, defaults to
+
+
+
+
+
+ 0-based identifier of the correct answer option, required for polls in quiz mode
+
+
+
+
+ Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a
+ quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing
+
+
+
+
+ Mode for parsing entities in the explanation. See
+ formatting options
+ for more details.
+
+
+
+
+ List of special entities that appear in the poll explanation, which can be specified instead
+ of
+
+
+
+
+ Amount of time in seconds the poll will be active after creation, 5-600. Can't be used
+ together with .
+
+
+
+
+ Point in time when the poll will be automatically closed. Must be at least 5 and no more
+ than 600 seconds in the future. Can't be used together with .
+
+
+
+
+ Pass , if the poll needs to be immediately closed. This can be useful for poll preview.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new request with chatId, question and
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Poll question, 1-300 characters
+ A list of answer options, 2-10 strings 1-100 characters each
+
+
+
+ As of v.4.0,
+ Telegram clients support rounded square mp4 videos of up to 1 minute long. Use this method
+ to send video messages. On success, the sent is returned.
+
+
+
+
+
+
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+
+
+
+ Video note to send. Pass a as String to send a video
+ note that exists on the Telegram servers (recommended) or upload a new video using
+ multipart/form-data. Sending video notes by a URL is currently unsupported
+
+
+
+
+ Duration of sent video in seconds
+
+
+
+
+ Video width and height, i.e. diameter of the video message
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new request with chatId and videoNote
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+ Video note to send. Pass a as String to send a video
+ note that exists on the Telegram servers (recommended) or upload a new video using
+ multipart/form-data. Sending video notes by a URL is currently unsupported
+
+
+
+
+
+
+
+ Use this method to send video files, Telegram clients support mp4 videos (other formats may be
+ sent as ). On success, the sent is returned.
+ Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.
+
+
+
+
+
+
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+
+
+
+ Video to send. Pass a as String to send a video that
+ exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to
+ get a video from the Internet, or upload a new video using multipart/form-data
+
+
+
+
+ Duration of sent video in seconds
+
+
+
+
+ Video width
+
+
+
+
+ Video height
+
+
+
+
+
+
+
+ Video caption (may also be used when resending videos by file_id),
+ 0-1024 characters after entities parsing
+
+
+
+
+
+
+
+
+
+
+ Pass if the photo needs to be covered with a spoiler animation
+
+
+
+
+ Pass , if the uploaded video is suitable for streaming
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new request with chatId and video
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+ Video to send. Pass a as String to send a video that
+ exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to
+ get a video from the Internet, or upload a new video using multipart/form-data
+
+
+
+
+
+
+
+ Use this method to send audio files, if you want Telegram clients to display the file as a playable
+ voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other
+ formats may be sent as or ). On success, the sent
+ is returned. Bots can currently send voice messages of up to 50 MB in size,
+ this limit may be changed in the future.
+
+
+
+
+
+
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+
+
+
+ Audio file to send. Pass a as String to send a file that
+ exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get
+ a file from the Internet, or upload a new one using multipart/form-data
+
+
+
+
+ Voice message caption, 0-1024 characters after entities parsing
+
+
+
+
+
+
+
+
+
+
+ Duration of the voice message in seconds
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new request with chatId and voice
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+ Audio file to send. Pass a as String to send a file
+ that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram
+ to get a file from the Internet, or upload a new one using multipart/form-data
+
+
+
+
+
+
+
+ Use this method to change the bot’s menu button in a private chat, or the default menu button.
+ Returns on success.
+
+
+
+
+ Optional. Unique identifier for the target private chat. If not specified, default bot’s menu button
+ will be changed
+
+
+
+
+ Optional. An object for the new bot’s menu button. Defaults to
+
+
+
+
+ Initializes a new request
+
+
+
+
+ Use this method to change the default administrator rights requested by the bot when it's added as an
+ administrator to groups or channels. These rights will be suggested to users, but they are free to
+ modify the list before adding the bot. Returns on success.
+
+
+
+
+ Optional. An object describing new default administrator rights. If not specified, the default administrator
+ rights will be cleared.
+
+
+
+
+ Optional. Pass to change the default administrator rights of the bot in channels. Otherwise,
+ the default administrator rights of the bot for groups and supergroups will be changed.
+
+
+
+
+ Initializes a new request
+
+
+
+
+ Use this method to change the bot's name. Returns on success.
+
+
+
+
+ New bot name; 0-64 characters. Pass an empty string to remove the dedicated name for the given language.
+
+
+
+
+ A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose language
+ there is no dedicated name.
+
+
+
+
+ Initializes a new request
+
+
+
+
+ Use this method to get the current bot short description
+ for the given user language.
+ Returns on success.
+
+
+
+
+ A two-letter ISO 639-1 language code or an empty string
+
+
+
+
+ Initializes a new request
+
+
+
+
+ Use this method to change the bot's short description,which is shown on
+ the bot's profile page and is sent together with the link when users share the bot.
+ Returns on success.
+
+
+
+
+ New short description for the bot; 0-120 characters.
+ Pass an empty string to remove the dedicated short description for the given language.
+
+
+
+
+ A two-letter ISO 639-1 language code. If empty, the short description will be
+ applied to all users for whose language there is no dedicated short description.
+
+
+
+
+ Initializes a new request
+
+
+
+
+ Represents an API request with a file
+
+ Type of result expected in result
+
+
+
+ Initializes an instance of request
+
+ Bot API method
+
+
+
+ Initializes an instance of request
+
+ Bot API method
+ HTTP method to use
+
+
+
+ Generate multipart form data content
+
+
+
+
+
+
+
+ Generate multipart form data content
+
+
+
+
+
+
+ Use this method to get data for high score tables. Will return the score of the specified user
+ and several of their neighbors in a game. On success, returns an Array of
+ objects.
+
+
+ This method will currently return scores for the target user, plus two of their closest neighbors
+ on each side. Will also return the top three users if the user and his neighbors are not among
+ them. Please note that this behavior is subject to change.
+
+
+
+
+
+
+
+ Unique identifier for the target chat
+
+
+
+
+
+
+
+ Identifier of the sent message
+
+
+
+
+ Initializes a new request with userId, chatId and messageId
+
+ Target user id
+ Unique identifier for the target chat
+ Identifier of the sent message
+
+
+
+ Use this method to get data for high score tables. Will return the score of the specified user
+ and several of their neighbors in a game. On success, returns an Array of
+ objects.
+
+
+ This method will currently return scores for the target user, plus two of their closest neighbors
+ on each side. Will also return the top three users if the user and his neighbors are not among them.
+ Please note that this behavior is subject to change.
+
+
+
+
+
+
+
+
+
+
+ Initializes a new request with userId and inlineMessageId
+
+ User identifier
+ Identifier of the inline message
+
+
+
+ Use this method to send a game. On success, the sent is returned.
+
+
+
+
+ Unique identifier for the target chat
+
+
+
+
+
+
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+
+
+
+ Short name of the game, serves as the unique identifier for the game. Set up your games
+ via @Botfather
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new request with chatId and gameShortName
+
+ Unique identifier for the target chat
+
+ Short name of the game, serves as the unique identifier for the game. Set up your games via
+ @Botfather
+
+
+
+
+ Use this method to set the score of the specified user in a game. On success returns the edited
+ . Returns an error, if the new score is not greater than the user's current
+ score in the chat and is .
+
+
+
+
+
+
+
+ New score, must be non-negative
+
+
+
+
+ Pass , if the high score is allowed to decrease. This can be useful when fixing mistakes
+ or banning cheaters.
+
+
+
+
+ Pass , if the game message should not be automatically edited to include
+ the current scoreboard
+
+
+
+
+ Unique identifier for the target chat
+
+
+
+
+
+
+
+ Identifier of the sent message
+
+
+
+
+ Initializes a new request
+
+ User identifier
+ New score, must be non-negative
+ Unique identifier for the target chat
+ Identifier of the sent message
+
+
+
+ Use this method to set the score of the specified user in a game. On success returns .
+ Returns an error, if the new score is not greater than the user's current score in the chat and
+ is .
+
+
+
+
+
+
+
+ New score, must be non-negative
+
+
+
+
+ Pass , if the high score is allowed to decrease. This can be useful when fixing mistakes
+ or banning cheaters.
+
+
+
+
+ Pass , if the game message should not be automatically edited to include the current
+ scoreboard
+
+
+
+
+
+
+
+ Initializes a new request with userId, inlineMessageId and new score
+
+ User identifier
+ New score, must be non-negative
+ Identifier of the inline message
+
+
+
+ Use this method to remove webhook integration if you decide to switch back to
+ . Returns on success.
+
+
+
+
+ Pass to drop all pending updates
+
+
+
+
+ Initializes a new request
+
+
+
+
+ Use this method to receive incoming updates using long polling
+ (wiki).
+ An Array of objects is returned.
+
+
+
+ This method will not work if an outgoing webhook is set up.
+
+ In order to avoid getting duplicate updates, recalculate
+ after each server response.
+
+
+
+
+
+
+ Identifier of the first update to be returned. Must be greater by one than the highest among
+ the identifiers of previously received updates. By default, updates starting with the earliest
+ unconfirmed update are returned. An update is considered confirmed as soon as
+ is called with an higher than its
+ . The negative offset can be specified to retrieve updates
+ starting from -offset update from the end of the updates queue.
+ All previous updates will forgotten.
+
+
+
+
+ Limits the number of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100
+
+
+
+
+ Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive,
+ short polling should be used for testing purposes only.
+
+
+
+
+ A list of the update types you want your bot to receive. For example, specify
+ [, ,
+ ] to only receive updates of these types.
+ See for a complete list of available update types. Specify
+ an empty list to receive all update types except
+ (default). If not specified, the previous setting will be used.
+
+
+ Please note that this parameter doesn't affect updates created before the call to the
+ getUpdates, so unwanted updates may be received for a short period of time.
+
+
+
+
+ Initializes a new GetUpdates request
+
+
+
+
+ Use this method to get current webhook status. Requires no parameters. On success, returns
+ a object. If the bot is using ,
+ will return an object with the field empty.
+
+
+
+
+ Initializes a new request
+
+
+
+
+ Use this method to specify a URL and receive incoming updates via an outgoing webhook.
+ Whenever there is an update for the bot, we will send an HTTPS POST request to the
+ specified URL, containing a JSON-serialized . In case of
+ an unsuccessful request, we will give up after a reasonable amount of attempts.
+ Returns on success.
+
+ If you'd like to make sure that the webhook was set by you, you can specify secret data
+ in the parameter . If specified, the request
+ will contain a header "X-Telegram-Bot-Api-Secret-Token" with the secret token as content.
+
+
+
+
+ You will not be able to receive updates using for as long as an outgoing
+ webhook is set up.
+
+ To use a self-signed certificate, you need to upload your
+ public key certificate using
+ parameter. Please upload as , sending
+ a String will not work.
+
+ Ports currently supported for webhooks: 443, 80, 88, 8443
+
+ If you're having any trouble setting up webhooks, please check out this
+ amazing guide to Webhooks.
+
+
+
+
+
+ HTTPS URL to send updates to. Use an empty string to remove webhook integration
+
+
+
+
+ Upload your public key certificate so that the root certificate in use can be checked. See
+ our self-signed guide for details
+
+
+
+
+ The fixed IP address which will be used to send webhook requests instead of the
+ IP address resolved through DNS
+
+
+
+
+ Maximum allowed number of simultaneous HTTPS connections to the webhook for update
+ delivery, 1-100. Defaults to 40. Use lower values to limit the load on your
+ bot's server, and higher values to increase your bot's throughput.
+
+
+
+
+ A list of the update types you want your bot to receive. For example, specify
+ [, ,
+ ] to only receive updates of these types.
+ See for a complete list of available update types.
+ Specify an empty list to receive all update types except
+ (default). If not specified,
+ the previous setting will be used
+
+
+ Please note that this parameter doesn't affect updates created before the call to the
+ , so unwanted updates may be received for a short period of time.
+
+
+
+
+ Pass to drop all pending updates
+
+
+
+
+ A secret token to be sent in a header "X-Telegram-Bot-Api-Secret-Token" in every webhook request,
+ 1-256 characters. Only characters A-Z, a-z, 0-9, _ and -
+ are allowed. The header is useful to ensure that the request comes from a webhook set by you.
+
+
+
+
+ Initializes a new request with uri
+
+
+ HTTPS url to send updates to. Use an empty string to remove webhook integration
+
+
+
+
+
+
+
+ Use this method to send answers to an inline query. On success, is returned.
+
+
+ No more than 50 results per query are allowed.
+
+
+
+
+ Unique identifier for the answered query
+
+
+
+
+ An array of results for the inline query
+
+
+
+
+ The maximum amount of time in seconds that the result of the
+ inline query may be cached on the server. Defaults to 300
+
+
+
+
+ Pass , if results may be cached on the server side only for the user that sent
+ the query. By default, results may be returned to any user who sends the same query
+
+
+
+
+ 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
+
+
+
+
+ A JSON-serialized object describing a button to be shown above inline query results
+
+
+
+
+ Initializes a new request with inlineQueryId and an array of
+
+ Unique identifier for the answered query
+ An array of results for the inline query
+
+
+
+ Use this method to set the result of an interaction with a
+ Web App and send a corresponding message on behalf of the
+ user to the chat from which the query originated. On success, a object is returned.
+
+
+
+
+ Unique identifier for the query to be answered
+
+
+
+
+ An object describing the message to be sent
+
+
+
+
+ Initializes a new request with and a
+
+ Unique identifier for the query to be answered
+ An object describing the message to be sent
+
+
+
+ Represents a request that doesn't require any parameters
+
+
+
+
+
+ Initializes an instance of
+
+ Name of request method
+
+
+
+ Initializes an instance of
+
+ Name of request method
+ HTTP request method
+
+
+
+
+
+
+ Once the user has confirmed their payment and shipping details, the Bot API sends the final
+ confirmation in the form of an with the field
+ . Use this method to respond to such pre-checkout
+ queries. On success, is returned.
+
+
+ The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.
+
+
+
+
+ Unique identifier for the query to be answered
+
+
+
+
+ Specify if everything is alright (goods are available, etc.) and the
+ bot is ready to proceed with the order. Use if there are any problems.
+
+
+
+
+ Required if is . Error message in human readable form that explains
+ the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought
+ the last of our amazing black T-shirts while you were busy filling out your payment details.
+ Please choose a different color or garment!"). Telegram will display this message to the user.
+
+
+
+
+ Initializes a new successful answerPreCheckoutQuery request
+
+ Unique identifier for the query to be answered
+
+
+
+ Initializes a new failing answerPreCheckoutQuery request with error message
+
+ Unique identifier for the query to be answered
+
+ Required if is . Error message in human readable form that explains the
+ reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of
+ our amazing black T-shirts while you were busy filling out your payment details. Please
+ choose a different color or garment!"). Telegram will display this message to the user.
+
+
+
+
+ If you sent an invoice requesting a shipping address and the parameter
+ was specified, the Bot API will send an
+ with a field to the
+ bot. Use this method to reply to shipping queries. On success, is returned.
+
+
+
+
+ Unique identifier for the query to be answered
+
+
+
+
+ Specify if delivery to the specified address is possible and
+ if there are any problems (for example, if delivery to the specified address is not possible)
+
+
+
+
+ Required if is . An array of available shipping options.
+
+
+
+
+ Required if is . Error message in human readable form that explains
+ why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address
+ is unavailable'). Telegram will display this message to the user.
+
+
+
+
+ Initializes a new failing answerShippingQuery request with error message
+
+ Unique identifier for the query to be answered
+ Error message in human readable form
+
+
+
+ Initializes a new successful answerShippingQuery request with shipping options
+
+ Unique identifier for the query to be answered
+ A JSON-serialized array of available shipping options
+
+
+
+ Use this method to create a link for an invoice. Returns the created invoice link as string on success.
+
+
+
+
+ Product name, 1-32 characters
+
+
+
+
+ Product description, 1-255 characters
+
+
+
+
+ Bot-defined invoice payload, 1-128 bytes.This will not be displayed to the user,
+ use for your internal processes.
+
+
+
+
+ Payments provider token, obtained via @Botfather
+
+
+
+
+ Three-letter ISO 4217 currency code, see
+ more on currencies
+
+
+
+
+ Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost,
+ delivery tax, bonus, etc.)
+
+
+
+
+ The maximum accepted amount for tips in the smallest units of the currency.
+ For example, for a maximum tip of US$ 1.45 pass = 145.
+ See the exp parameter in
+ currencies.json,
+ it shows the number of digits past the decimal point for each currency (2 for the majority
+ of currencies). Defaults to 0
+
+
+
+
+ An array of suggested amounts of tips in the smallest units of the currency. At most 4
+ suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a
+ strictly increased order and must not exceed
+
+
+
+
+ JSON-serialized data about the invoice, which will be shared with the payment provider.
+ A detailed description of required fields should be provided by the payment provider.
+
+
+
+
+ URL of the product photo for the invoice. Can be a photo of the goods or a marketing image
+ for a service.
+
+
+
+
+ Photo size in bytes
+
+
+
+
+ Photo width
+
+
+
+
+ Photo height
+
+
+
+
+ Pass , if you require the user's full name to complete the order
+
+
+
+
+ Pass , if you require the user's phone number to complete the order
+
+
+
+
+ Pass , if you require the user's email to complete the order
+
+
+
+
+ Pass , if you require the user's shipping address to complete the order
+
+
+
+
+ Pass , if user's phone number should be sent to provider
+
+
+
+
+ Pass , if user's email address should be sent to provider
+
+
+
+
+ Pass , if the final price depends on the shipping method
+
+
+
+
+ Initializes a new request with title, description, payload, providerToken, currency
+ and an array of
+
+ Product name, 1-32 characters
+ Product description, 1-255 characters
+ Bot-defined invoice payload, 1-128 bytes
+
+ Payments provider token, obtained via @Botfather
+
+
+ Three-letter ISO 4217 currency code, see
+ more on currencies
+
+
+ Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost,
+ delivery tax, bonus, etc.)
+
+
+
+
+ Use this method to send invoices. On success, the sent is returned.
+
+
+
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+
+
+
+
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+
+
+
+ Product name, 1-32 characters
+
+
+
+
+ Product description, 1-255 characters
+
+
+
+
+ Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user,
+ use for your internal processes
+
+
+
+
+ Payments provider token, obtained via @Botfather
+
+
+
+
+ Three-letter ISO 4217 currency code, see
+ more on currencies
+
+
+
+
+ Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost,
+ delivery tax, bonus, etc.)
+
+
+
+
+ The maximum accepted amount for tips in the smallest units of the currency.
+ For example, for a maximum tip of US$ 1.45 pass = 145.
+ See the exp parameter in
+ currencies.json,
+ it shows the number of digits past the decimal point for each currency (2 for the majority
+ of currencies). Defaults to 0
+
+
+
+
+ An array of suggested amounts of tips in the smallest units of the currency. At most 4
+ suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a
+ strictly increased order and must not exceed
+
+
+
+
+ Unique deep-linking parameter. If left empty, forwarded copies of the sent message will
+ have a Pay button, allowing multiple users to pay directly from the forwarded message,
+ using the same invoice. If non-empty, forwarded copies of the sent message will have a URL
+ button with a deep link to the bot (instead of a Pay button), with the value used as the
+ start parameter
+
+
+
+
+ A JSON-serialized data about the invoice, which will be shared with the payment provider.
+ A detailed description of required fields should be provided by the payment provider.
+
+
+
+
+ URL of the product photo for the invoice. Can be a photo of the goods or a marketing image
+ for a service. People like it better when they see what they are paying for.
+
+
+
+
+ Photo size
+
+
+
+
+ Photo width
+
+
+
+
+ Photo height
+
+
+
+
+ Pass , if you require the user's full name to complete the order
+
+
+
+
+ Pass , if you require the user's phone number to complete the order
+
+
+
+
+ Pass , if you require the user's email to complete the order
+
+
+
+
+ Pass , if you require the user's shipping address to complete the order
+
+
+
+
+ Pass , if user's phone number should be sent to provider
+
+
+
+
+ Pass , if user's email address should be sent to provider
+
+
+
+
+ Pass , if the final price depends on the shipping method
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new request with chatId, title, description, payload, providerToken, currency
+ and an array of
+
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Product name, 1-32 characters
+ Product description, 1-255 characters
+ Bot-defined invoice payload, 1-128 bytes
+
+ Payments provider token, obtained via @Botfather
+
+
+ Three-letter ISO 4217 currency code, see
+ more on currencies
+
+
+ Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost,
+ delivery tax, bonus, etc.)
+
+
+
+
+ Represents an API request
+
+ Type of result expected in result
+
+
+
+
+
+
+
+
+
+ Initializes an instance of request
+
+ Bot API method
+
+
+
+ Initializes an instance of request
+
+ Bot API method
+ HTTP method to use
+
+
+
+ Generate content of HTTP message
+
+ Content of HTTP request
+
+
+
+
+
+
+ If is set to is set to the method
+ name, otherwise it won't be serialized
+
+
+
+
+ Use this method to add a new sticker to a set created by the bot.
+ The format of the added sticker must match the format of the other stickers in the set.
+
+
+ Emoji sticker sets can have up to 200 stickers.
+
+
+ Animated and video sticker sets can have up to 50 stickers.
+
+
+ Static sticker sets can have up to 120 stickers.
+
+
+ Returns on success.
+
+
+
+
+
+
+
+ Sticker set name
+
+
+
+
+ A JSON-serialized object with information about the added sticker.
+ If exactly the same sticker had already been added to the set, then the set isn't changed.
+
+
+
+
+ Initializes a new request with userId, name and sticker
+
+
+ User identifier
+
+
+ Sticker set name
+
+
+ A JSON-serialized object with information about the added sticker.
+ If exactly the same sticker had already been added to the set, then the set isn't changed.
+
+
+
+
+
+
+
+ Use this method to create a new sticker set owned by a user.
+ The bot will be able to edit the sticker set thus created.
+ Returns on success.
+
+
+
+
+
+
+
+ Short name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals).
+ Can contain only English letters, digits and underscores. Must begin with a letter, can't
+ contain consecutive underscores and must end in "_by_<bot username>".
+ <bot_username> is case insensitive. 1-64 characters
+
+
+
+
+ Sticker set title, 1-64 characters
+
+
+
+
+ A JSON-serialized list of 1-50 initial stickers to be added to the sticker set
+
+
+
+
+ Format of stickers in the set.
+
+
+
+
+ Type of stickers in the set.
+ By default, a regular sticker set is created.
+
+
+
+
+ Pass if stickers in the sticker set must be repainted to the
+ color of text when used in messages, the accent color if used as emoji status, white
+ on chat photos, or another appropriate color based on context;
+ for custom emoji sticker sets only
+
+
+
+
+ Initializes a new request with userId, name, title, stickers and stickerFormat
+
+
+ User identifier of sticker set owner
+
+
+ Short name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals).
+ Can contain only english letters, digits and underscores. Must begin with a letter, can't
+ contain consecutive underscores and must end in "_by_<bot username>".
+ <bot_username> is case insensitive. 1-64 characters
+
+
+ Sticker set title, 1-64 characters
+
+
+ A JSON-serialized list of 1-50 initial stickers to be added to the sticker set
+
+
+ Format of stickers in the set.
+
+
+
+
+
+
+
+ Use this method to delete a sticker from a set created by the bot. Returns on success.
+
+
+
+
+ File identifier of the sticker
+
+
+
+
+ Initializes a new request with sticker
+
+
+ File identifier of the sticker
+
+
+
+
+ Use this method to delete a sticker set that was created by the bot.
+ Returns on success.
+
+
+
+
+ Sticker set name
+
+
+
+
+ Initializes a new request with name
+
+
+ Sticker set name
+
+
+
+
+ Use this method to get information about custom emoji stickers by their identifiers.
+ Returns an Array of objects.
+
+
+
+
+ List of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.
+
+
+
+
+ Initializes a new request with name
+
+ List of custom emoji identifiers. At most 200 custom emoji
+ identifiers can be specified.
+
+
+
+ Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user.
+ Requires no parameters.
+ Returns an Array of objects.
+
+
+
+
+ Initializes a new request
+
+
+
+
+ Use this method to get a sticker set. On success, a object is returned.
+
+
+
+
+ Name of the sticker set
+
+
+
+
+ Initializes a new request with name
+
+ Name of the sticker set
+
+
+
+ Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers.
+ On success, the sent is returned.
+
+
+
+
+
+
+
+ Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+
+
+
+ Sticker to send. Pass a as String to send a file that
+ exists on the Telegram servers (recommended), pass an HTTP URL as a String
+ for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP
+ or .TGS sticker using multipart/form-data.
+ Video stickers can only be sent by a .
+ Animated stickers can't be sent via an HTTP URL.
+
+
+
+
+ Optional. Emoji associated with the sticker; only for just uploaded stickers
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new request chatId and sticker
+
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+ Sticker to send. Pass a as String to send a file that
+ exists on the Telegram servers (recommended), pass an HTTP URL as a String
+ for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP
+ or .TGS sticker using multipart/form-data.
+ Video stickers can only be sent by a .
+ Animated stickers can't be sent via an HTTP URL.
+
+
+
+
+
+
+
+ Use this method to set the thumbnail of a custom emoji sticker set.
+ Returns on success.
+
+
+
+
+ Sticker set name
+
+
+
+
+ Optional. Custom emoji identifier of a from the ;
+ pass an to drop the thumbnail and use the first sticker as the thumbnail.
+
+
+
+
+ Initializes a new request with name
+
+
+ Sticker set name
+
+
+
+
+ Use this method to change the list of emoji assigned to a regular or custom emoji sticker.
+ The sticker must belong to a sticker set created by the bot.
+ Returns on success.
+
+
+
+
+ File identifier of the sticker
+
+
+
+
+ A JSON-serialized list of 1-20 emoji associated with the sticker
+
+
+
+
+ Initializes a new request with sticker and emojiList
+
+
+ File identifier of the sticker
+
+
+ A JSON-serialized list of 1-20 emoji associated with the sticker
+
+
+
+
+ Use this method to change search keywords assigned to a regular or custom emoji sticker.
+ The sticker must belong to a sticker set created by the bot.
+ Returns on success.
+
+
+
+
+ File identifier of the sticker
+
+
+
+
+ Optional. A JSON-serialized list of 0-20 search keywords for the sticker
+ with total length of up to 64 characters
+
+
+
+
+ Initializes a new request with sticker
+
+
+ File identifier of the sticker
+
+
+
+
+ Use this method to change the mask position of a mask sticker.
+ The sticker must belong to a sticker set that was created by the bot.
+ Returns on success.
+
+
+
+
+ File identifier of the sticker
+
+
+
+
+ A JSON-serialized object with the position where the mask should be placed on faces.
+ Omit the parameter to remove the mask position.
+
+
+
+
+ Initializes a new request with sticker
+
+
+ File identifier of the sticker
+
+
+
+
+ Use this method to move a sticker in a set created by the bot to a specific position.
+ Returns on success.
+
+
+
+
+ File identifier of the sticker
+
+
+
+
+ New sticker position in the set, zero-based
+
+
+
+
+ Initializes a new request with sticker and position
+
+
+ File identifier of the sticker
+
+ New sticker position in the set, zero-based
+
+
+
+ Use this method to set the thumbnail of a regular or mask sticker set.
+ The format of the thumbnail file must match the format of the stickers in the set.
+ Returns on success.
+
+
+
+
+ Sticker set name
+
+
+
+
+
+
+
+ A .WEBP or .PNG image with the thumbnail, must be up to 128 kilobytes in size and have
+ a width and height of exactly 100px, or a .TGS animation with a thumbnail up to 32 kilobytes in
+ size (see for animated
+ sticker technical requirements), or a WEBM video with the thumbnail up to 32 kilobytes in size; see
+ for video sticker technical
+ requirements. Pass a as a String to send a file that already exists on the
+ Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or
+ upload a new one using multipart/form-data. Animated and video sticker set thumbnails can't be uploaded
+ via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.
+
+
+
+
+ Initializes a new request with sticker and position
+
+ Sticker set name
+ User identifier of the sticker set owner
+
+
+
+
+
+
+ Use this method to set the title of a created sticker set.
+ Returns on success.
+
+
+
+
+ Sticker set name
+
+
+
+
+ Sticker set title, 1-64 characters
+
+
+
+
+ Initializes a new request with name and title
+
+
+ Sticker set name
+
+
+ Sticker set title, 1-64 characters
+
+
+
+
+ Use this method to upload a file with a sticker for later use in the
+ and
+ methods (the file can be used multiple times).
+ Returns the uploaded on success.
+
+
+
+
+
+
+
+ A file with the sticker in .WEBP, .PNG, .TGS, or .WEBM format.
+
+
+
+
+ Format of the sticker
+
+
+
+
+ Initializes a new request with userId, sticker and stickerFormat
+
+
+ User identifier of sticker file owner
+
+
+ A file with the sticker in .WEBP, .PNG, .TGS, or .WEBM format.
+
+
+ Format of the sticker
+
+
+
+
+
+
+
+ Use this method to delete a message, including service messages, with the following limitations:
+
+ A message can only be deleted if it was sent less than 48 hours ago
+ A dice message in a private chat can only be deleted if it was sent more than 24 hours ago
+ Bots can delete outgoing messages in private chats, groups, and supergroups
+ Bots can delete incoming messages in private chats
+ Bots granted can_post_messages permissions can delete outgoing messages in channels
+ If the bot is an administrator of a group, it can delete any message there
+
+ If the bot has can_delete_messages permission in a supergroup or a channel,
+ it can delete any message there
+
+
+ Returns on success.
+
+
+
+
+
+
+
+ Identifier of the message to delete
+
+
+
+
+ Initializes a new request with chatId and messageId
+
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Identifier of the message to delete
+
+
+
+ Use this method to edit captions of messages. On success is returned.
+
+
+
+
+
+
+
+ New caption of the message, 0-1024 characters after entities parsing
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new request with inlineMessageId and new caption
+
+ Identifier of the inline message
+
+
+
+ Use this method to edit animation, audio, document, photo, or video messages. If a message is
+ part of a message album, then it can be edited only to an audio for audio albums, only to a
+ document for document albums and to a photo or a video otherwise. Use a previously uploaded file
+ via its or specify a URL. On success
+ is returned.
+
+
+
+
+
+
+
+ A new media content of the message
+
+
+
+
+
+
+
+ Initializes a new request with inlineMessageId and new media
+
+ Identifier of the inline message
+ A new media content of the message
+
+
+
+ Use this method to edit only the reply markup of messages. On success is returned.
+
+
+
+
+
+
+
+
+
+
+ Initializes a new request with inlineMessageId and new inline keyboard
+
+ Identifier of the inline message
+
+
+
+ Use this method to edit text and game messages. On success is returned.
+
+
+
+
+
+
+
+ New text of the message, 1-4096 characters after entities parsing
+
+
+
+
+
+
+
+
+
+
+ Disables link previews for links in this message
+
+
+
+
+
+
+
+ Initializes a new request with inlineMessageId and new text
+
+ Identifier of the inline message
+ New text of the message, 1-4096 characters after entities parsing
+
+
+
+ Use this method to edit captions of messages. On success the edited is returned.
+
+
+
+
+
+
+
+ Identifier of the message to edit
+
+
+
+
+ New caption of the message, 0-1024 characters after entities parsing
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new request with chatId and messageIdn
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Identifier of the message to edit
+
+
+
+ Use this method to edit animation, audio, document, photo, or video messages. If a message is part
+ of a message album, then it can be edited only to an audio for audio albums, only to a
+ document for document albums and to a photo or a video otherwise. Use a previously uploaded
+ file via its or specify a URL.
+ On success the edited is returned.
+
+
+
+
+
+
+
+ Identifier of the message to edit
+
+
+
+
+ A new media content of the message
+
+
+
+
+
+
+
+ Initializes a new request with chatId, messageId and new media
+
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Identifier of the message to edit
+ A new media content of the message
+
+
+
+
+
+
+ Use this method to edit only the reply markup of messages. On success the edited
+ is returned.
+
+
+
+
+
+
+
+ Identifier of the message to edit
+
+
+
+
+
+
+
+ Initializes a new request with chatId and messageId
+
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Identifier of the message to edit
+
+
+
+ Use this method to edit text and game messages. On success the edited is returned.
+
+
+
+
+
+
+
+ Identifier of the message to edit
+
+
+
+
+ New text of the message, 1-4096 characters after entities parsing
+
+
+
+
+
+
+
+
+
+
+ Disables link previews for links in this message
+
+
+
+
+
+
+
+ Initializes a new request with chatId, messageId and text
+
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Identifier of the message to edit
+ New text of the message, 1-4096 characters after entities parsing
+
+
+
+ Use this method to stop a poll which was sent by the bot. On success, the stopped
+ with the final results is returned.
+
+
+
+
+
+
+
+ Identifier of the original message with the poll
+
+
+
+
+
+
+
+ Initializes a new request with chatId, messageId
+
+
+ Unique identifier for the target chat or username of the target channel (in the format
+ @channelusername)
+
+ Identifier of the original message with the poll
+
+
+
+ A client to use the Telegram Bot API
+
+
+
+
+
+
+
+
+
+
+ Timeout for requests
+
+
+
+
+
+
+
+ Occurs before sending a request to API
+
+
+
+
+ Occurs after receiving the response to an API request
+
+
+
+
+ Create a new instance.
+
+ Configuration for
+ A custom
+
+ Thrown if is null
+
+
+
+
+ Create a new instance.
+
+
+ A custom
+
+ Thrown if format is invalid
+
+
+
+
+
+
+
+ Test the API token
+
+ if token is valid
+
+
+
+
+
+
+ Extension methods that map to requests from Bot API documentation
+
+
+ Provides extension methods for that allow for polling
+
+
+
+
+ Use this method to receive incoming updates using long polling
+ (wiki)
+
+ An instance of
+
+ Identifier of the first update to be returned. Must be greater by one than the highest among the
+ identifiers of previously received updates. By default, updates starting with the earliest unconfirmed
+ update are returned. An update is considered confirmed as soon as is called
+ with an higher than its . The negative offset can be
+ specified to retrieve updates starting from -offset update from the end
+ of the updates queue. All previous updates will forgotten.
+
+
+ Limits the number of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100
+
+
+ Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short
+ polling should be used for testing purposes only.
+
+
+ A list of the update types you want your bot to receive. For example, specify
+ [, ,
+ ] to only receive updates of these types. See
+ for a complete list of available update types. Specify an empty list to receive
+ all update types except (default). If not specified, the previous
+ setting will be used.
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+ This method will not work if an outgoing webhook is set up
+
+ In order to avoid getting duplicate updates, recalculate after each server
+ response
+
+
+
+ An Array of objects is returned.
+
+
+
+ Use this method to specify a URL and receive incoming updates via an outgoing webhook.
+ Whenever there is an update for the bot, we will send an HTTPS POST request to the
+ specified URL, containing a JSON-serialized . In case of
+ an unsuccessful request, we will give up after a reasonable amount of attempts.
+ Returns on success.
+
+ If you'd like to make sure that the webhook was set by you, you can specify secret data
+ in the parameter . If specified, the request
+ will contain a header "X-Telegram-Bot-Api-Secret-Token" with the secret token as content.
+
+
+ An instance of
+ HTTPS URL to send updates to. Use an empty string to remove webhook integration
+
+ Upload your public key certificate so that the root certificate in use can be checked. See our
+ self-signed guide for details
+
+
+ The fixed IP address which will be used to send webhook requests instead of the IP address resolved
+ through DNS
+
+
+ Maximum allowed number of simultaneous HTTPS connections to the webhook for update
+ delivery, 1-100. Defaults to 40. Use lower values to limit the load on your
+ bot's server, and higher values to increase your bot's throughput.
+
+
+ A list of the update types you want your bot to receive. For example, specify
+ [, ,
+ ] to only receive updates of these types. See
+ for a complete list of available update types. Specify an empty list to receive
+ all update types except (default). If not specified, the previous
+ setting will be used
+
+
+ Please note that this parameter doesn't affect updates created before the call to the
+ , so unwanted updates may be received for a short period of time.
+
+
+ Pass to drop all pending updates
+
+ A secret token to be sent in a header "X-Telegram-Bot-Api-Secret-Token" in every webhook request,
+ 1-256 characters. Only characters A-Z, a-z, 0-9, _ and -
+ are allowed. The header is useful to ensure that the request comes from a webhook set by you.
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ You will not be able to receive updates using for as long as an outgoing
+ webhook is set up
+
+
+ To use a self-signed certificate, you need to upload your
+ public key certificate using
+ parameter. Please upload as , sending a
+ string will not work
+
+ Ports currently supported for webhooks: 443, 80, 88, 8443
+
+ If you're having any trouble setting up webhooks, please check out this
+ amazing guide to Webhooks.
+
+
+
+
+ Use this method to remove webhook integration if you decide to switch back to
+
+ An instance of
+ Pass to drop all pending updates
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ Returns true on success
+
+
+
+ Use this method to get current webhook status.
+
+ An instance of
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+ On success, returns a object. If the bot is using ,
+ will return an object with the field empty.
+
+
+
+
+ A simple method for testing your bot’s auth token.
+
+ An instance of
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ Returns basic information about the bot in form of a object.
+
+
+
+ Use this method to log out from the cloud Bot API server before launching the bot locally. You must
+ log out the bot before running it locally, otherwise there is no guarantee that the bot will receive
+ updates. After a successful call, you can immediately log in on a local server, but will not be able to
+ log in back to the cloud Bot API server for 10 minutes.
+
+ An instance of
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to close the bot instance before moving it from one local server to another. You need to
+ delete the webhook before calling this method to ensure that the bot isn't launched again after server
+ restart. The method will return error 429 in the first 10 minutes after the bot is launched.
+
+ An instance of
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to send text messages.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Text of the message to be sent, 1-4096 characters after entities parsing
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+
+ Mode for parsing entities in the new caption. See
+ formatting options for more
+ details
+
+
+ List of special entities that appear in message text, which can be specified instead
+ of
+
+ Disables link previews for links in this message
+
+ Sends the message silently. Users will receive a notification with no sound
+
+ Protects the contents of sent messages from forwarding and saving
+ If the message is a reply, ID of the original message
+
+ Pass , if the message should be sent even if the specified replied-to message is not found
+
+
+ Additional interface options. An inline keyboard,
+ custom reply keyboard, instructions to
+ remove reply keyboard or to force a
+ reply from the user
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ On success, the sent is returned.
+
+
+
+ Use this method to forward messages of any kind. Service messages can't be forwarded.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+ Unique identifier for the chat where the original message was sent
+ (or channel username in the format @channelusername)
+
+ Message identifier in the chat specified in
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+
+ Sends the message silently. Users will receive a notification with no sound
+
+ Protects the contents of sent messages from forwarding and saving
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ On success, the sent is returned.
+
+
+
+ Use this method to copy messages of any kind. Service messages and invoice messages can't be copied.
+ The method is analogous to the method , but the copied message doesn't
+ have a link to the original message.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+ Unique identifier for the chat where the original message was sent
+ (or channel username in the format @channelusername)
+
+ Message identifier in the chat specified in
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+
+ New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption
+ is kept
+
+
+ Mode for parsing entities in the new caption. See
+ formatting options for
+ more details
+
+
+ List of special entities that appear in the caption, which can be specified instead
+ of
+
+
+ Sends the message silently. Users will receive a notification with no sound
+
+ Protects the contents of sent messages from forwarding and saving
+ If the message is a reply, ID of the original message
+
+ Pass , if the message should be sent even if the specified replied-to message is not found
+
+
+ Additional interface options. An inline keyboard,
+ custom reply keyboard, instructions to
+ remove reply keyboard or to
+ force a reply from the user
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ Returns the of the sent message on success.
+
+
+
+ Use this method to send photos.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+ Photo to send. Pass a as String to send a photo that exists on
+ the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from
+ the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size.
+ The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20
+
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+
+ Photo caption (may also be used when resending photos by ),
+ 0-1024 characters after entities parsing
+
+
+ Mode for parsing entities in the new caption. See
+ formatting options for
+ more details
+
+
+ List of special entities that appear in the caption, which can be specified instead
+ of
+
+
+ Pass if the photo needs to be covered with a spoiler animation
+
+
+ Sends the message silently. Users will receive a notification with no sound
+
+ Protects the contents of sent messages from forwarding and saving
+ If the message is a reply, ID of the original message
+
+ Pass , if the message should be sent even if the specified replied-to message is not found
+
+
+ Additional interface options. An inline keyboard,
+ custom reply keyboard, instructions to
+ remove reply keyboard or to
+ force a reply from the user
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ On success, the sent is returned.
+
+
+
+ Use this method to send audio files, if you want Telegram clients to display them in the music player.
+ Your audio must be in the .MP3 or .M4A format. Bots can currently send audio files of up to 50 MB in size,
+ this limit may be changed in the future.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+ Audio file to send. Pass a as String to send an audio file that
+ exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio
+ file from the Internet, or upload a new one using multipart/form-data
+
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+ Audio caption, 0-1024 characters after entities parsing
+
+ Mode for parsing entities in the new caption. See
+ formatting options for
+ more details
+
+
+ List of special entities that appear in the caption, which can be specified instead
+ of
+
+ Duration of the audio in seconds
+ Performer
+ Track name
+
+ Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side.
+ The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height
+ should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be
+ reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the
+ thumbnail was uploaded using multipart/form-data under <file_attach_name>
+
+
+ Sends the message silently. Users will receive a notification with no sound
+
+ Protects the contents of sent messages from forwarding and saving
+ If the message is a reply, ID of the original message
+
+ Pass , if the message should be sent even if the specified replied-to message is not found
+
+
+ Additional interface options. An inline keyboard,
+ custom reply keyboard, instructions to
+ remove reply keyboard or to
+ force a reply from the user
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ On success, the sent is returned.
+
+
+
+ Use this method to send general files. Bots can currently send files of any type of up to 50 MB in size,
+ this limit may be changed in the future.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+ File to send. Pass a as String to send a file that exists on the
+ Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet,
+ or upload a new one using multipart/form-data
+
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+
+ Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side.
+ The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should
+ not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused
+ and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the
+ thumbnail was uploaded using multipart/form-data under <file_attach_name>
+
+
+ Document caption (may also be used when resending documents by file_id), 0-1024 characters after
+ entities parsing
+
+
+ Mode for parsing entities in the new caption. See
+ formatting options for
+ more details
+
+
+ List of special entities that appear in the caption, which can be specified instead
+ of
+
+
+ Disables automatic server-side content type detection for files uploaded using multipart/form-data
+
+
+ Sends the message silently. Users will receive a notification with no sound
+
+ Protects the contents of sent messages from forwarding and saving
+ If the message is a reply, ID of the original message
+
+ Pass , if the message should be sent even if the specified replied-to message is not found
+
+
+ Additional interface options. An inline keyboard,
+ custom reply keyboard, instructions to
+ remove reply keyboard or to
+ force a reply from the user
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ On success, the sent is returned.
+
+
+
+ Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as
+ ). Bots can currently send video files of up to 50 MB in size, this limit may be
+ changed in the future.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+ Video to send. Pass a as String to send a video that exists on
+ the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the
+ Internet, or upload a new video using multipart/form-data
+
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+ Duration of sent video in seconds
+ Video width
+ Video height
+
+ Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side.
+ The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should
+ not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused
+ and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the
+ thumbnail was uploaded using multipart/form-data under <file_attach_name>
+
+
+ Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing
+
+
+ Mode for parsing entities in the new caption. See
+ formatting options for
+ more details
+
+
+ List of special entities that appear in the caption, which can be specified instead
+ of
+
+
+ Pass if the video needs to be covered with a spoiler animation
+
+ Pass , if the uploaded video is suitable for streaming
+
+ Sends the message silently. Users will receive a notification with no sound
+
+ Protects the contents of sent messages from forwarding and saving
+ If the message is a reply, ID of the original message
+
+ Pass , if the message should be sent even if the specified replied-to message is not found
+
+
+ Additional interface options. An inline keyboard,
+ custom reply keyboard, instructions to
+ remove reply keyboard or to
+ force a reply from the user
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ On success, the sent is returned.
+
+
+
+ Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). Bots can currently
+ send animation files of up to 50 MB in size, this limit may be changed in the future.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+ Animation to send. Pass a as String to send an animation that
+ exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an
+ animation from the Internet, or upload a new animation using multipart/form-data
+
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+ Duration of sent animation in seconds
+ Animation width
+ Animation height
+
+ Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side.
+ The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should
+ not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused
+ and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the
+ thumbnail was uploaded using multipart/form-data under <file_attach_name>
+
+
+ Animation caption (may also be used when resending animation by ),
+ 0-1024 characters after entities parsing
+
+
+ Mode for parsing entities in the new caption. See
+ formatting options for
+ more details
+
+
+ List of special entities that appear in the caption, which can be specified instead
+ of
+
+
+ Pass if the animatopn needs to be covered with a spoiler animation
+
+
+ Sends the message silently. Users will receive a notification with no sound
+
+ Protects the contents of sent messages from forwarding and saving
+ If the message is a reply, ID of the original message
+
+ Pass , if the message should be sent even if the specified replied-to message is not found
+
+
+ Additional interface options. An inline keyboard,
+ custom reply keyboard, instructions to
+ remove reply keyboard or to
+ force a reply from the user
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ On success, the sent is returned.
+
+
+
+ Use this method to send audio files, if you want Telegram clients to display the file as a playable voice
+ message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent
+ as or ). Bots can currently send voice messages of up to 50 MB
+ in size, this limit may be changed in the future.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+ Audio file to send. Pass a as String to send a file that exists
+ on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from
+ the Internet, or upload a new one using multipart/form-data
+
+ Voice message caption, 0-1024 characters after entities parsing
+
+ Mode for parsing entities in the new caption. See
+ formatting options for
+ more details
+
+
+ List of special entities that appear in the caption, which can be specified instead
+ of
+
+ Duration of the voice message in seconds
+
+ Sends the message silently. Users will receive a notification with no sound
+
+ Protects the contents of sent messages from forwarding and saving
+ If the message is a reply, ID of the original message
+
+ Pass , if the message should be sent even if the specified replied-to message is not found
+
+
+ Additional interface options. An inline keyboard,
+ custom reply keyboard, instructions to
+ remove reply keyboard or to
+ force a reply from the user
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ On success, the sent is returned.
+
+
+
+ As of v.4.0, Telegram clients
+ support rounded square mp4 videos of up to 1 minute long. Use this method to send video messages.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+ Video note to send. Pass a as String to send a video note that
+ exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. Sending
+ video notes by a URL is currently unsupported
+
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+ Duration of sent video in seconds
+ Video width and height, i.e. diameter of the video message
+
+ Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side.
+ The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should
+ not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused
+ and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the
+ thumbnail was uploaded using multipart/form-data under <file_attach_name>
+
+
+ Sends the message silently. Users will receive a notification with no sound
+
+ Protects the contents of sent messages from forwarding and saving
+ If the message is a reply, ID of the original message
+
+ Pass , if the message should be sent even if the specified replied-to message is not found
+
+
+ Additional interface options. An inline keyboard,
+ custom reply keyboard, instructions to
+ remove reply keyboard or to
+ force a reply from the user
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ On success, the sent is returned.
+
+
+
+ Use this method to send a group of photos, videos, documents or audios as an album. Documents and audio
+ files can be only grouped in an album with messages of the same type.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ An array describing messages to be sent, must include 2-10 items
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+
+ Sends the message silently. Users will receive a notification with no sound
+
+ Protects the contents of sent messages from forwarding and saving
+ If the message is a reply, ID of the original message
+
+ Pass , if the message should be sent even if the specified replied-to message is not found
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ On success, an array of s that were sent is returned.
+
+
+
+ Use this method to send point on the map.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Latitude of location
+ Longitude of location
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+
+ Period in seconds for which the location will be updated, should be between 60 and 86400
+
+
+ For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360
+ if specified
+
+
+ For live locations, a maximum distance for proximity alerts about approaching another chat member,
+ in meters. Must be between 1 and 100000 if specified
+
+
+ Sends the message silently. Users will receive a notification with no sound
+
+ Protects the contents of sent messages from forwarding and saving
+ If the message is a reply, ID of the original message
+
+ Pass , if the message should be sent even if the specified replied-to message is not found
+
+
+ Additional interface options. An inline keyboard,
+ custom reply keyboard, instructions to
+ remove reply keyboard or to
+ force a reply from the user
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ On success, the sent is returned.
+
+
+
+ Use this method to edit live location messages. A location can be edited until its
+ expires or editing is explicitly disabled by a call to
+ .
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Identifier of the message to edit
+ Latitude of new location
+ Longitude of new location
+
+ The radius of uncertainty for the location, measured in meters; 0-1500
+
+
+ Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified
+
+
+ Maximum distance for proximity alerts about approaching another chat member, in meters.
+ Must be between 1 and 100000 if specified
+
+
+ Additional interface options. An inline keyboard,
+ custom reply keyboard, instructions to
+ remove reply keyboard or to
+ force a reply from the user
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ On success the edited is returned.
+
+
+
+ Use this method to edit live location messages. A location can be edited until its
+ expires or editing is explicitly disabled by a call to
+ .
+
+ An instance of
+ Identifier of the inline message
+ Latitude of new location
+ Longitude of new location
+
+ The radius of uncertainty for the location, measured in meters; 0-1500
+
+
+ Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified
+
+
+ Maximum distance for proximity alerts about approaching another chat member, in meters.
+ Must be between 1 and 100000 if specified
+
+
+ Additional interface options. An inline keyboard,
+ custom reply keyboard, instructions to
+ remove reply keyboard or to
+ force a reply from the user
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to stop updating a live location message before
+ expires.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Identifier of the sent message
+
+ Additional interface options. An inline keyboard,
+ custom reply keyboard, instructions to
+ remove reply keyboard or to
+ force a reply from the user
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ On success the sent is returned.
+
+
+
+ Use this method to stop updating a live location message before
+ expires.
+
+ An instance of
+ Identifier of the inline message
+
+ Additional interface options. An inline keyboard,
+ custom reply keyboard, instructions to
+ remove reply keyboard or to
+ force a reply from the user
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to send information about a venue.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Latitude of the venue
+ Longitude of the venue
+ Name of the venue
+ Address of the venue
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+ Foursquare identifier of the venue
+
+ Foursquare type of the venue, if known. (For example, “arts_entertainment/default”,
+ “arts_entertainment/aquarium” or “food/icecream”.)
+
+ Google Places identifier of the venue
+
+ Google Places type of the venue. (See
+ supported types)
+
+
+ Sends the message silently. Users will receive a notification with no sound
+
+ Protects the contents of sent messages from forwarding and saving
+ If the message is a reply, ID of the original message
+
+ Pass , if the message should be sent even if the specified replied-to message is not found
+
+
+ Additional interface options. An inline keyboard,
+ custom reply keyboard, instructions to
+ remove reply keyboard or to
+ force a reply from the user
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ On success, the sent is returned.
+
+
+
+
+ Use this method to send phone contacts.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Contact's phone number
+ Contact's first name
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+ Contact's last name
+ Additional data about the contact in the form of a vCard, 0-2048 bytes
+
+ Sends the message silently. Users will receive a notification with no sound
+
+ Protects the contents of sent messages from forwarding and saving
+ If the message is a reply, ID of the original message
+
+ Pass , if the message should be sent even if the specified replied-to message is not found
+
+
+ Additional interface options. An inline keyboard,
+ custom reply keyboard, instructions to
+ remove reply keyboard or to
+ force a reply from the user
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ On success, the sent is returned.
+
+
+
+ Use this method to send a native poll.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Poll question, 1-300 characters
+ A list of answer options, 2-10 strings 1-100 characters each
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+ , if the poll needs to be anonymous, defaults to
+
+ Poll type, or ,
+ defaults to
+
+
+ , if the poll allows multiple answers, ignored for polls in quiz mode,
+ defaults to
+
+
+ 0-based identifier of the correct answer option, required for polls in quiz mode
+
+
+ Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll,
+ 0-200 characters with at most 2 line feeds after entities parsing
+
+
+ Mode for parsing entities in the explanation. See
+ formatting options
+ for more details
+
+
+ List of special entities that appear in the poll explanation, which can be specified instead
+ of
+
+
+ Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together
+ with
+
+
+ Point in time when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds
+ in the future. Can't be used together with
+
+
+ Pass , if the poll needs to be immediately closed. This can be useful for poll preview
+
+
+ Sends the message silently. Users will receive a notification with no sound
+
+ Protects the contents of sent messages from forwarding and saving
+ If the message is a reply, ID of the original message
+
+ Pass , if the message should be sent even if the specified replied-to message is not found
+
+
+ Additional interface options. An inline keyboard,
+ custom reply keyboard, instructions to
+ remove reply keyboard or to
+ force a reply from the user
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ On success, the sent is returned.
+
+
+
+ Use this method to send an animated emoji that will display a random value.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+
+ Emoji on which the dice throw animation is based. Currently, must be one of ,
+ , , ,
+ or . Dice can have values 1-6 for
+ , and , values 1-5 for
+ and , and values 1-64 for
+ . Defauts to
+
+
+ Sends the message silently. Users will receive a notification with no sound
+
+ Protects the contents of sent messages from forwarding and saving
+ If the message is a reply, ID of the original message
+
+ Pass , if the message should be sent even if the specified replied-to message is not found
+
+
+ Additional interface options. An inline keyboard,
+ custom reply keyboard, instructions to
+ remove reply keyboard or to
+ force a reply from the user
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ On success, the sent is returned.
+
+
+
+ Use this method when you need to tell the user that something is happening on the bot’s side. The status is
+ set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status).
+
+
+
+ The ImageBot needs some time to process a request and upload the
+ image. Instead of sending a text message along the lines of “Retrieving image, please wait…”, the bot may
+ use with = .
+ The user will see a “sending photo” status for the bot.
+
+
+ We only recommend using this method when a response from the bot will take a noticeable amount of
+ time to arrive.
+
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+ Type of action to broadcast. Choose one, depending on what the user is about to receive:
+ for text messages,
+ for photos,
+ or for
+ videos, or
+ for voice notes,
+ for general files,
+ for location data,
+ or for
+ video notes
+
+ Unique identifier for the target message thread; supergroups only
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to get a list of profile pictures for a user.
+
+ An instance of
+ Unique identifier of the target user
+
+ Sequential number of the first photo to be returned. By default, all photos are returned
+
+
+ Limits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ Returns a object
+
+
+
+ Use this method to get basic info about a file and prepare it for downloading. For the moment, bots can
+ download files of up to 20MB in size. The file can then be downloaded via the link
+ https://api.telegram.org/file/bot<token>/<file_path>, where <file_path>
+ is taken from the response. It is guaranteed that the link will be valid for at least 1 hour.
+ When the link expires, a new one can be requested by calling again.
+
+
+ You can use or
+ methods to download the file
+
+ An instance of
+ File identifier to get info about
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ On success, a object is returned.
+
+
+
+ Use this method to get basic info about a file download it. For the moment, bots can download files
+ of up to 20MB in size.
+
+ An instance of
+ File identifier to get info about
+ Destination stream to write file to
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ On success, a object is returned.
+
+
+
+ Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and
+ channels, the user will not be able to return to the chat on their own using invite links, etc., unless
+ unbanned
+ first. The bot must be an administrator in the chat for this to work and must have the appropriate
+ admin rights.
+
+ An instance of
+
+ Unique identifier for the target group or username of the target supergroup or channel
+ (in the format @channelusername)
+
+ Unique identifier of the target user
+
+ Date when the user will be unbanned. If user is banned for more than 366 days or less than 30 seconds
+ from the current time they are considered to be banned forever. Applied for supergroups and channels only
+
+
+ Pass to delete all messages from the chat for the user that is being removed.
+ If , the user will be able to see messages in the group that were sent before the user was
+ removed. Always for supergroups and channels
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to unban a previously banned user in a supergroup or channel. The user will not
+ return to the group or channel automatically, but will be able to join via link, etc. The bot must be an
+ administrator for this to work. By default, this method guarantees that after the call the user is not a
+ member of the chat, but will be able to join it. So if the user is a member of the chat they will also be
+ removed from the chat. If you don't want this, use the parameter
+
+ An instance of
+
+ Unique identifier for the target group or username of the target supergroup or channel
+ (in the format @username)
+
+ Unique identifier of the target user
+ Do nothing if the user is not banned
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup
+ for this to work and must have the appropriate admin rights. Pass for all permissions to
+ lift restrictions from a user.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target supergroup
+ (in the format @supergroupusername)
+
+ Unique identifier of the target user
+ New user permissions
+
+ Pass if chat permissions are set independently. Otherwise, the
+ , and
+ permissions will imply the ,
+ , ,
+ , ,
+ , and
+ permissions; the permission will imply the
+ permission.
+
+ Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever.
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Pass for all boolean parameters to demote a user.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Unique identifier of the target user
+ Pass , if the administrator's presence in the chat is hidden
+ Pass , if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege
+ Pass , if the administrator can create channel posts, channels only
+ Pass , if the administrator can edit messages of other users, channels only
+ Pass , if the administrator can delete messages of other users
+ Pass , if the administrator can manage voice chats, supergroups only
+ Pass , if the administrator can restrict, ban or unban chat members
+ Pass , if the administrator can add new administrators with a subset of his own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him)
+ Pass , if the administrator can change chat title, photo and other settings
+ Pass , if the administrator can invite new users to the chat
+ Pass , if the administrator can pin messages, supergroups only
+ Pass if the user is allowed to create, rename, close, and reopen forum topics, supergroups only
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to set a custom title for an administrator in a supergroup promoted by the bot.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target supergroup
+ (in the format @supergroupusername)
+
+ Unique identifier of the target user
+
+ New custom title for the administrator; 0-16 characters, emoji are not allowed
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to ban a channel chat in a supergroup or a channel. The owner of the chat will not be
+ able to send messages and join live streams on behalf of the chat, unless it is unbanned first. The bot
+ must be an administrator in the supergroup or channel for this to work and must have the appropriate
+ administrator rights. Returns on success.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target supergroup
+ (in the format @supergroupusername)
+
+ Unique identifier of the target sender chat
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to unban a previously banned channel chat in a supergroup or channel. The bot must be
+ an administrator for this to work and must have the appropriate administrator rights.
+ Returns on success.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target supergroup
+ (in the format @supergroupusername)
+
+ Unique identifier of the target sender chat
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to set default chat permissions for all members. The bot must be an administrator
+ in the group or a supergroup for this to work and must have the can_restrict_members admin rights
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target supergroup
+ (in the format @supergroupusername)
+
+ New default chat permissions
+
+ Pass if chat permissions are set independently. Otherwise, the
+ , and
+ permissions will imply the ,
+ , ,
+ , ,
+ , and
+ permissions; the permission will imply the
+ permission.
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to generate a new primary invite link for a chat; any previously generated primary
+ link is revoked. The bot must be an administrator in the chat for this to work and must have the
+ appropriate admin rights
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to create an additional invite link for a chat. The bot must be an administrator
+ in the chat for this to work and must have the appropriate admin rights. The link can be revoked
+ using the method
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Invite link name; 0-32 characters
+ Point in time when the link will expire
+
+ Maximum number of users that can be members of the chat simultaneously after joining the chat
+ via this invite link; 1-99999
+
+
+ Set to , if users joining the chat via the link need to be approved by chat administrators.
+ If , can't be specified
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ Returns the new invite link as object.
+
+
+
+ Use this method to edit a non-primary invite link created by the bot. The bot must be an
+ administrator in the chat for this to work and must have the appropriate admin rights
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ The invite link to edit
+ Invite link name; 0-32 characters
+ Point in time when the link will expire
+
+ Maximum number of users that can be members of the chat simultaneously after joining the chat
+ via this invite link; 1-99999
+
+
+ Set to , if users joining the chat via the link need to be approved by chat administrators.
+ If , can't be specified
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ Returns the edited invite link as a object.
+
+
+
+ Use this method to revoke an invite link created by the bot. If the primary link is revoked, a new
+ link is automatically generated. The bot must be an administrator in the chat for this to work and
+ must have the appropriate admin rights
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ The invite link to revoke
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ Returns the revoked invite link as object.
+
+
+
+ Use this method to approve a chat join request. The bot must be an administrator in the chat for this to
+ work and must have the administrator right.
+ Returns on success.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Unique identifier of the target user
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to decline a chat join request. The bot must be an administrator in the chat for this to
+ work and must have the administrator right.
+ Returns on success.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Unique identifier of the target user
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to set a new profile photo for the chat. Photos can't be changed for private chats.
+ The bot must be an administrator in the chat for this to work and must have the appropriate admin rights
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ New chat photo, uploaded using multipart/form-data
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an
+ administrator in the chat for this to work and must have the appropriate admin rights
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to change the title of a chat. Titles can't be changed for private chats. The bot
+ must be an administrator in the chat for this to work and must have the appropriate admin rights
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ New chat title, 1-255 characters
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to change the description of a group, a supergroup or a channel. The bot must
+ be an administrator in the chat for this to work and must have the appropriate admin rights
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ New chat Description, 0-255 characters
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private
+ chat, the bot must be an administrator in the chat for this to work and must have the
+ '' admin right in a supergroup or
+ '' admin right in a channel
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Identifier of a message to pin
+
+ Pass , if it is not necessary to send a notification to all chat members about
+ the new pinned message. Notifications are always disabled in channels and private chats
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to remove a message from the list of pinned messages in a chat. If the chat is not
+ a private chat, the bot must be an administrator in the chat for this to work and must have the
+ '' admin right in a supergroup or
+ '' admin right in a channel
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+ Identifier of a message to unpin. If not specified, the most recent pinned message (by sending date)
+ will be unpinned
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat,
+ the bot must be an administrator in the chat for this to work and must have the
+ '' admin right in a supergroup or
+ '' admin right in a channel
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method for your bot to leave a group, supergroup or channel.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target supergroup or channel
+ (in the format @channelusername)
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to get up to date information about the chat (current name of the user for one-on-one
+ conversations, current username of a user, group or channel, etc.)
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target supergroup or channel
+ (in the format @channelusername)
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ Returns a object on success.
+
+
+
+ Use this method to get a list of administrators in a chat.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target supergroup or channel
+ (in the format @channelusername)
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+ On success, returns an Array of objects that contains information about all chat
+ administrators except other bots. If the chat is a group or a supergroup and no administrators were
+ appointed, only the creator will be returned
+
+
+
+
+ Use this method to get the number of members in a chat.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target supergroup or channel
+ (in the format @channelusername)
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ Returns on success..
+
+
+
+ Use this method to get information about a member of a chat.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target supergroup or channel
+ (in the format @channelusername)
+
+ Unique identifier of the target user
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ Returns a object on success.
+
+
+
+ Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the
+ chat for this to work and must have the appropriate admin rights. Use the field
+ optionally returned in requests to check
+ if the bot can use this method.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Name of the sticker set to be set as the group sticker set
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the
+ chat for this to work and must have the appropriate admin rights. Use the field
+ optionally returned in requests to
+ check if the bot can use this method
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user.
+
+ An instance of
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ Returns an Array of objects.
+
+
+
+ Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for
+ this to work and must have the administrator rights.
+ Returns information about the created topic as a object.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Topic name, 1-128 characters
+
+ Color of the topic icon in RGB format. Currently, must be one of 7322096 (0x6FB9F0), 16766590 (0xFFD67E),
+ 13338331 (0xCB86DB), 9367192 (0x8EEE98), 16749490 (0xFF93B2), or 16478047 (0xFB6F5F)
+
+
+ Unique identifier of the custom emoji shown as the topic icon. Use
+ to get all allowed custom emoji identifiers
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+ Returns information about the created topic as a object.
+
+
+
+
+ Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator
+ in the chat for this to work and must have administrator
+ rights, unless it is the creator of the topic. Returns on success.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Unique identifier for the target message thread of the forum topic
+
+ New topic name, 0-128 characters. If not specified or empty, the current name of the topic will be kept
+
+
+ New unique identifier of the custom emoji shown as the topic icon. Use
+ to get all allowed custom emoji identifiers. Pass an empty
+ string to remove the icon. If not specified, the current icon will be kept
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to close an open topic in a forum supergroup chat. The bot must be an administrator in the chat
+ for this to work and must have the administrator rights,
+ unless it is the creator of the topic. Returns on success.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Unique identifier for the target message thread of the forum topic
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to reopen a closed topic in a forum supergroup chat. The bot must be an administrator in the
+ chat for this to work and must have the administrator
+ rights, unless it is the creator of the topic. Returns on success.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Unique identifier for the target message thread of the forum topic
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be
+ an administrator in the chat for this to work and must have the
+ administrator rights. Returns
+ on success.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Unique identifier for the target message thread of the forum topic
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the
+ chat for this to work and must have the administrator
+ right in the supergroup. Returns on success.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Unique identifier for the target message thread of the forum topic
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an
+ administrator in the chat for this to work and must have
+ administrator rights. Returns on success.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ New topic name, 1-128 characters
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to close an open 'General' topic in a forum supergroup chat. The bot must be an administrator
+ in the chat for this to work and must have the
+ administrator rights. Returns on success.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to reopen a closed 'General' topic in a forum supergroup chat. The bot must be an
+ administrator in the chat for this to work and must have the
+ administrator rights. The topic will be automatically
+ unhidden if it was hidden. Returns on success.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to hide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the
+ chat for this to work and must have the administrator
+ rights. The topic will be automatically closed if it was open. Returns on success.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to uhhide the 'General' topic in a forum supergroup chat. The bot must be an administrator
+ in the chat for this to work and must have the
+ administrator rights. Returns on success.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to send answers to callback queries sent from
+ inline keyboards. The answer will be displayed
+ to the user as a notification at the top of the chat screen or as an alert
+
+
+ Alternatively, the user can be redirected to the specified Game URL.For this option to work, you must
+ first create a game for your bot via @Botfather and accept the terms. Otherwise, you may use
+ links like t.me/your_bot?start=XXXX that open your bot with a parameter
+
+ An instance of
+ Unique identifier for the query to be answered
+
+ Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters
+
+
+ If , an alert will be shown by the client instead of a notification at the top of the chat
+ screen. Defaults to
+
+
+ URL that will be opened by the user's client. If you have created a
+ Game and accepted the conditions via
+ @Botfather, specify the URL that opens your game — note that this will only work if the query
+ comes from a callback_game button
+
+ Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter
+
+
+
+ The maximum amount of time in seconds that the result of the callback query may be cached client-side.
+ Telegram apps will support caching starting in version 3.14
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to set the result of an interaction with a Web App and send a corresponding message on
+ behalf of the user to the chat from which the query originated. On success, a
+ object is returned.
+
+ An instance of
+ Unique identifier for the query to be answered
+
+ An object describing the message to be sent
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to change the list of the bot’s commands.
+ See for more details about bot commands
+
+ An instance of
+
+ A list of bot commands to be set as the list of the bot’s commands. At most 100 commands can be specified
+
+
+ An object, describing scope of users for which the commands are relevant.
+ Defaults to .
+
+
+ A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given
+ , for whose language there are no dedicated commands
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to delete the list of the bot’s commands for the given and
+ user language. After deletion,
+ higher level commands
+ will be shown to affected users
+
+ An instance of
+
+ An object, describing scope of users for which the commands are relevant.
+ Defaults to .
+
+
+ A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given
+ , for whose language there are no dedicated commands
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to get the current list of the bot’s commands for the given and
+ user language
+
+ An instance of
+
+ An object, describing scope of users. Defaults to .
+
+
+ A two-letter ISO 639-1 language code or an empty string
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+ Returns Array of on success. If commands aren't set, an empty list is returned
+
+
+
+
+ Use this method to change the bot's name.
+
+ An instance of
+
+ New bot name; 0-64 characters. Pass an empty string to remove the dedicated name for the given language.
+
+
+ A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose language
+ there is no dedicated name.
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to get the current bot name for the given user language.
+
+ An instance of
+
+ A two-letter ISO 639-1 language code or an empty string
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+ Returns on success.
+
+
+
+
+ Use this method to change the bot's description, which is shown in the chat
+ with the bot if the chat is empty.
+
+ An instance of
+
+ New bot description; 0-512 characters. Pass an empty string to remove the
+ dedicated description for the given language.
+
+
+ A two-letter ISO 639-1 language code. If empty, the description will be applied
+ to all users for whose language there is no dedicated description.
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to get the current bot description
+ for the given user language.
+
+ An instance of
+
+ A two-letter ISO 639-1 language code or an empty string
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+ Returns on success.
+
+
+
+
+ Use this method to change the bot's short description,which is shown on
+ the bot's profile page and is sent together with the link when users share the bot.
+
+ An instance of
+
+ New short description for the bot; 0-120 characters.
+ Pass an empty string to remove the dedicated short description for the given language.
+
+
+ A two-letter ISO 639-1 language code. If empty, the short description will be
+ applied to all users for whose language there is no dedicated short description.
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+
+ Use this method to get the current bot short description
+ for the given user language.
+
+ An instance of
+
+ A two-letter ISO 639-1 language code or an empty string
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+ Returns on success.
+
+
+
+
+ Use this method to change the bot’s menu button in a private chat, or the default menu button.
+
+ An instance of
+
+ Unique identifier for the target private chat. If not specified, default bot’s menu button will be changed
+
+
+ An object for the new bot’s menu button. Defaults to
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to get the current value of the bot’s menu button in a private chat,
+ or the default menu button.
+
+ An instance of
+
+ Unique identifier for the target private chat. If not specified, default bot’s menu button will be returned
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ set for the given chat id or a default one
+
+
+
+ Use this method to change the default administrator rights requested by the bot when it's added as an
+ administrator to groups or channels. These rights will be suggested to users, but they are free to modify
+ the list before adding the bot.
+
+ An instance of
+
+ An object describing new default administrator rights. If not specified, the default administrator rights
+ will be cleared.
+
+
+ Pass to change the default administrator rights of the bot in channels. Otherwise, the default
+ administrator rights of the bot for groups and supergroups will be changed.
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to get the current default administrator rights of the bot.
+
+ An instance of
+
+ Pass to change the default administrator rights of the bot in channels. Otherwise, the default
+ administrator rights of the bot for groups and supergroups will be changed.
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ Default or channel
+
+
+
+ Use this method to edit text and game messages.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Identifier of the message to edit
+ New text of the message, 1-4096 characters after entities parsing
+
+ Mode for parsing entities in the new caption. See
+ formatting options for
+ more details
+
+
+ List of special entities that appear in message text, which can be specified instead
+ of
+
+ Disables link previews for links in this message
+
+ Additional interface options. An inline keyboard,
+ custom reply keyboard, instructions to
+ remove reply keyboard or to
+ force a reply from the user
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ On success the edited is returned.
+
+
+
+ Use this method to edit text and game messages.
+
+ An instance of
+ Identifier of the inline message
+ New text of the message, 1-4096 characters after entities parsing
+
+ Mode for parsing entities in the new caption. See
+ formatting options for
+ more details
+
+
+ List of special entities that appear in message text, which can be specified instead
+ of
+
+ Disables link previews for links in this message
+
+ Additional interface options. An inline keyboard,
+ custom reply keyboard, instructions to
+ remove reply keyboard or to
+ force a reply from the user
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to edit captions of messages.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ dentifier of the message to edit
+ New caption of the message, 0-1024 characters after entities parsing
+
+ Mode for parsing entities in the new caption. See
+ formatting options for
+ more details
+
+
+ List of special entities that appear in the caption, which can be specified instead
+ of
+
+
+ Additional interface options. An inline keyboard,
+ custom reply keyboard, instructions to
+ remove reply keyboard or to
+ force a reply from the user
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ On success the edited is returned.
+
+
+
+ Use this method to edit captions of messages.
+
+ An instance of
+ Identifier of the inline message
+ New caption of the message, 0-1024 characters after entities parsing
+
+ Mode for parsing entities in the new caption. See
+ formatting options for
+ more details
+
+
+ List of special entities that appear in the caption, which can be specified instead
+ of
+
+
+ Additional interface options. An inline keyboard,
+ custom reply keyboard, instructions to
+ remove reply keyboard or to
+ force a reply from the user
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to edit animation, audio, document, photo, or video messages. If a message is part of
+ a message album, then it can be edited only to an audio for audio albums, only to a document for document
+ albums and to a photo or a video otherwise. Use a previously uploaded file via its
+ or specify a URL
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Identifier of the message to edit
+ A new media content of the message
+
+ Additional interface options. An inline keyboard,
+ custom reply keyboard, instructions to
+ remove reply keyboard or to
+ force a reply from the user
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ On success the edited is returned.
+
+
+
+ Use this method to edit animation, audio, document, photo, or video messages. If a message is part of
+ a message album, then it can be edited only to an audio for audio albums, only to a document for document
+ albums and to a photo or a video otherwise. Use a previously uploaded file via its
+ or specify a URL
+
+ An instance of
+ Identifier of the inline message
+ A new media content of the message
+
+ Additional interface options. An inline keyboard,
+ custom reply keyboard, instructions to
+ remove reply keyboard or to
+ force a reply from the user
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to edit only the reply markup of messages.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Identifier of the message to edit
+
+ Additional interface options. An inline keyboard,
+ custom reply keyboard, instructions to
+ remove reply keyboard or to
+ force a reply from the user
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ On success the edited is returned.
+
+
+
+ Use this method to edit only the reply markup of messages.
+
+ An instance of
+ Identifier of the inline message
+
+ Additional interface options. An inline keyboard,
+ custom reply keyboard, instructions to
+ remove reply keyboard or to
+ force a reply from the user
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to stop a poll which was sent by the bot.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Identifier of the original message with the poll
+
+ Additional interface options. An inline keyboard,
+ custom reply keyboard, instructions to
+ remove reply keyboard or to
+ force a reply from the user
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ On success, the stopped with the final results is returned.
+
+
+
+ Use this method to delete a message, including service messages, with the following limitations:
+
+ A message can only be deleted if it was sent less than 48 hours ago
+ A dice message in a private chat can only be deleted if it was sent more than 24 hours ago
+ Bots can delete outgoing messages in private chats, groups, and supergroups
+ Bots can delete incoming messages in private chats
+ Bots granted can_post_messages permissions can delete outgoing messages in channels
+ If the bot is an administrator of a group, it can delete any message there
+
+ If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there
+
+
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Identifier of the message to delete
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers.
+
+
+ An instance of
+
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+
+ Sticker to send. Pass a as String to send a file that
+ exists on the Telegram servers (recommended), pass an HTTP URL as a String
+ for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP
+ or .TGS sticker using multipart/form-data.
+ Video stickers can only be sent by a .
+ Animated stickers can't be sent via an HTTP URL.
+
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+
+ Emoji associated with the sticker; only for just uploaded stickers
+
+
+ Sends the message silently. Users will receive a notification with no sound
+
+
+ Protects the contents of sent messages from forwarding and saving
+
+
+ If the message is a reply, ID of the original message
+
+
+ Pass , if the message should be sent even if the specified
+ replied-to message is not found
+
+
+ Additional interface options. An inline keyboard,
+ custom reply keyboard, instructions to
+ remove reply keyboard or to
+ force a reply from the user
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+ On success, the sent is returned.
+
+
+
+
+ Use this method to get a sticker set.
+
+
+ An instance of
+
+
+ Name of the sticker set
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+ On success, a object is returned.
+
+
+
+
+ Use this method to get information about custom emoji stickers by their identifiers.
+ Returns an Array of objects.
+
+ An instance of
+ List of custom emoji identifiers. At most 200 custom emoji
+ identifiers can be specified.
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ On success, a object is returned.
+
+
+
+ Use this method to upload a file with a sticker for later use in the
+ and
+ methods (the file can be used multiple times).
+
+
+ An instance of
+
+
+ User identifier of sticker file owner
+
+
+ A file with the sticker in .WEBP, .PNG, .TGS, or .WEBM format.
+
+
+ Format of the sticker
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+ Returns the uploaded on success.
+
+
+
+
+ Use this method to create a new sticker set owned by a user.
+
+
+ An instance of
+
+
+ User identifier of created sticker set owner
+
+
+ Short name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals). Can contain
+ only english letters, digits and underscores. Must begin with a letter, can't contain consecutive
+ underscores and must end in "_by_<bot username>". <bot_username> is case
+ insensitive. 1-64 characters
+
+
+ Sticker set title, 1-64 characters
+
+
+ A JSON-serialized list of 1-50 initial stickers to be added to the sticker set
+
+
+ Format of stickers in the set.
+
+
+ Type of stickers in the set.
+ By default, a regular sticker set is created.
+
+
+ Pass if stickers in the sticker set must be repainted to the
+ color of text when used in messages, the accent color if used as emoji status, white
+ on chat photos, or another appropriate color based on context;
+ for custom emoji sticker sets only
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to add a new sticker to a set created by the bot.
+ The format of the added sticker must match the format of the other stickers in the set.
+
+
+ Emoji sticker sets can have up to 200 stickers.
+
+
+ Animated and video sticker sets can have up to 50 stickers.
+
+
+ Static sticker sets can have up to 120 stickers.
+
+
+
+
+ An instance of
+
+
+ User identifier of sticker set owner
+
+
+ Sticker set name
+
+
+ A JSON-serialized object with information about the added sticker.
+ If exactly the same sticker had already been added to the set, then the set isn't changed.
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to move a sticker in a set created by the bot to a specific position.
+
+ An instance of
+
+ File identifier of the sticker
+
+ New sticker position in the set, zero-based
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to delete a sticker from a set created by the bot.
+
+ An instance of
+
+ File identifier of the sticker
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to change the list of emoji assigned to a regular or custom emoji sticker.
+ The sticker must belong to a sticker set created by the bot.
+
+
+ An instance of
+
+
+ File identifier of the sticker
+
+
+ A JSON-serialized list of 1-20 emoji associated with the sticker
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to change search keywords assigned to a regular or custom emoji sticker.
+ The sticker must belong to a sticker set created by the bot.
+
+
+ An instance of
+
+
+ File identifier of the sticker
+
+
+ Optional. A JSON-serialized list of 0-20 search keywords for the sticker
+ with total length of up to 64 characters
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to change the mask position of a mask sticker.
+ The sticker must belong to a sticker set that was created by the bot.
+
+
+ An instance of
+
+
+ File identifier of the sticker
+
+
+ A JSON-serialized object with the position where the mask should be placed on faces.
+ Omit the parameter to remove the mask position.
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to set the title of a created sticker set.
+
+
+ An instance of
+
+
+ Sticker set name
+
+
+ Sticker set title, 1-64 characters
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to set the thumbnail of a regular or mask sticker set.
+ The format of the thumbnail file must match the format of the stickers in the set.
+ Returns on success.
+
+
+ An instance of
+
+
+ Sticker set name
+
+
+ User identifier of the sticker set owner
+
+
+ A .WEBP or .PNG image with the thumbnail, must be up to 128 kilobytes in size and have
+ a width and height of exactly 100px, or a .TGS animation with a thumbnail up to 32 kilobytes in
+ size (see for animated
+ sticker technical requirements), or a WEBM video with the thumbnail up to 32 kilobytes in size; see
+ for video sticker technical
+ requirements. Pass a as a String to send a file that already exists on the
+ Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or
+ upload a new one using multipart/form-data. Animated and video sticker set thumbnails can't be uploaded
+ via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to set the thumbnail of a custom emoji sticker set.
+
+
+ An instance of
+
+
+ Sticker set name
+
+
+ Custom emoji identifier of a from the ;
+ pass an to drop the thumbnail and use the first sticker as the thumbnail.
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to delete a sticker set that was created by the bot.
+
+
+ An instance of
+
+
+ Sticker set name
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to send answers to an inline query.
+
+
+ No more than 50 results per query are allowed.
+
+ An instance of
+ Unique identifier for the answered query
+ An array of results for the inline query
+
+ The maximum amount of time in seconds that the result of the inline query may be cached on the server.
+ Defaults to 300
+
+
+ Pass , if results may be cached on the server side only for the user that sent the query.
+ By default, results may be returned to any user who sends the same query
+
+
+ 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
+
+
+ A JSON-serialized object describing a button to be shown above inline query results
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to send invoices.
+
+ An instance of
+
+ Unique identifier for the target chat or username of the target channel
+ (in the format @channelusername)
+
+ Product name, 1-32 characters
+ Product description, 1-255 characters
+
+ Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user,
+ use for your internal processes
+
+
+ Payments provider token, obtained via @Botfather
+
+
+ Three-letter ISO 4217 currency code, see
+ more on currencies
+
+
+ Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax,
+ bonus, etc.)
+
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+
+ The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double).
+ For example, for a maximum tip of US$ 1.45 pass = 145.
+ See the exp parameter in
+ currencies.json, it shows the
+ number of digits past the decimal point for each currency (2 for the majority of currencies).
+ Defaults to 0
+
+
+ An array of suggested amounts of tips in the smallest units of the currency (integer,
+ not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must
+ be positive, passed in a strictly increased order and must not exceed
+
+
+ Unique deep-linking parameter. If left empty, forwarded copies of the sent message will have
+ a Pay button, allowing multiple users to pay directly from the forwarded message, using the same
+ invoice. If non-empty, forwarded copies of the sent message will have a URL button with a deep
+ link to the bot (instead of a Pay button), with the value used as the start parameter
+
+
+ A JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed
+ description of required fields should be provided by the payment provide
+
+
+ URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service.
+ People like it better when they see what they are paying for
+
+ Photo size
+ Photo width
+ Photo height
+ Pass , if you require the user's full name to complete the order
+
+ Pass , if you require the user's phone number to complete the order
+
+ Pass , if you require the user's email to complete the order
+
+ Pass , if you require the user's shipping address to complete the order
+
+
+ Pass , if user's phone number should be sent to provider
+
+
+ Pass , if user's email address should be sent to provider
+
+ Pass , if the final price depends on the shipping method
+
+ Sends the message silently. Users will receive a notification with no sound
+
+ Protects the contents of sent messages from forwarding and saving
+ If the message is a reply, ID of the original message
+
+ Pass , if the message should be sent even if the specified replied-to message is not found
+
+
+ Additional interface options. An inline keyboard,
+ custom reply keyboard, instructions to
+ remove reply keyboard or to
+ force a reply from the user
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ On success, the sent is returned.
+
+
+
+ Use this method to create a link for an invoice.
+
+ An instance of
+ Product name, 1-32 characters
+ Product description, 1-255 characters
+
+ Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user,
+ use for your internal processes
+
+
+ Payments provider token, obtained via @Botfather
+
+
+ Three-letter ISO 4217 currency code, see
+ more on currencies
+
+
+ Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax,
+ bonus, etc.)
+
+
+ The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double).
+ For example, for a maximum tip of US$ 1.45 pass = 145.
+ See the exp parameter in
+ currencies.json, it shows the
+ number of digits past the decimal point for each currency (2 for the majority of currencies).
+ Defaults to 0
+
+
+ An array of suggested amounts of tips in the smallest units of the currency (integer,
+ not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must
+ be positive, passed in a strictly increased order and must not exceed
+
+
+ JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed
+ description of required fields should be provided by the payment provide
+
+
+ URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service.
+
+ Photo size
+ Photo width
+ Photo height
+ Pass , if you require the user's full name to complete the order
+
+ Pass , if you require the user's phone number to complete the order
+
+ Pass , if you require the user's email to complete the order
+
+ Pass , if you require the user's shipping address to complete the order
+
+
+ Pass , if user's phone number should be sent to provider
+
+
+ Pass , if user's email address should be sent to provider
+
+ Pass , if the final price depends on the shipping method
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ On success, the sent is returned.
+
+
+
+ If you sent an invoice requesting a shipping address and the parameter isFlexible" was specified,
+ the Bot API will send an with a field
+ to the bot. Use this method to reply to shipping queries
+
+ An instance of
+ Unique identifier for the query to be answered
+
+ Required if ok is . An array of available shipping options
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ If you sent an invoice requesting a shipping address and the parameter isFlexible" was specified,
+ the Bot API will send an with a field
+ to the bot. Use this method to indicate failed shipping query
+
+ An instance of
+ Unique identifier for the query to be answered
+
+ Required if is . Error message in
+ human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to
+ your desired address is unavailable'). Telegram will display this message to the user
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation
+ in the form of an with the field .
+ Use this method to respond to such pre-checkout queries.
+
+
+ Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.
+
+ An instance of
+ Unique identifier for the query to be answered
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation
+ in the form of an with the field .
+ Use this method to respond to indicate failed pre-checkout query
+
+ An instance of
+ Unique identifier for the query to be answered
+
+ Required if is . Error message in
+ human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry,
+ somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment
+ details. Please choose a different color or garment!"). Telegram will display this message to the user
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+
+
+ Use this method to send a game.
+
+ An instance of
+ Unique identifier for the target chat
+
+
+ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
+
+ Short name of the game, serves as the unique identifier for the game. Set up your games via
+ @Botfather
+
+
+ Sends the message silently. Users will receive a notification with no sound
+
+ Protects the contents of sent messages from forwarding and saving
+ If the message is a reply, ID of the original message
+
+ Pass , if the message should be sent even if the specified replied-to message is not found
+
+
+ Additional interface options. An inline keyboard,
+ custom reply keyboard, instructions to
+ remove reply keyboard or to
+ force a reply from the user
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ On success, the sent is returned.
+
+
+
+ Use this method to set the score of the specified user in a game.
+
+ An instance of
+ User identifier
+ New score, must be non-negative
+ Unique identifier for the target chat
+ Identifier of the sent message
+
+ Pass , if the high score is allowed to decrease. This can be useful when fixing mistakes
+ or banning cheaters
+
+
+ Pass , if the game message should not be automatically edited to include the current scoreboard
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+ On success returns the edited . Returns an error, if the new score is not greater
+ than the user's current score in the chat and is
+
+
+
+
+ Use this method to set the score of the specified user in a game.
+
+ An instance of
+ User identifier
+ New score, must be non-negative
+ Identifier of the inline message.
+
+ Pass , if the high score is allowed to decrease. This can be useful when fixing mistakes
+ or banning cheaters
+
+
+ Pass , if the game message should not be automatically edited to include the current scoreboard
+
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+
+ Returns an error, if the new score is not greater than the user's current score in the chat and
+ is
+
+
+
+
+ Use this method to get data for high score tables. Will return the score of the specified user and
+ several of their neighbors in a game.
+
+
+ This method will currently return scores for the target user, plus two of their closest neighbors on
+ each side. Will also return the top three users if the user and his neighbors are not among them.
+ Please note that this behavior is subject to change.
+
+ An instance of
+ Target user id
+ Unique identifier for the target chat
+ Identifier of the sent message
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ On success, returns an Array of objects.
+
+
+
+ Use this method to get data for high score tables. Will return the score of the specified user and
+ several of their neighbors in a game.
+
+
+ This method will currently return scores for the target user, plus two of their closest neighbors
+ on each side. Will also return the top three users if the user and his neighbors are not among them.
+ Please note that this behavior is subject to change.
+
+ An instance of
+ User identifier
+ Identifier of the inline message
+
+ A cancellation token that can be used by other objects or threads to receive notice of cancellation
+
+ On success, returns an Array of objects.
+
+
+
+ Starts receiving s on the ThreadPool, invoking
+ for each.
+
+ This method does not block. GetUpdates will be called AFTER the
+ returns
+
+
+
+ The used for processing s
+
+ The used for making GetUpdates calls
+ Options used to configure getUpdates request
+
+ The with which you can stop receiving
+
+
+
+
+ Starts receiving s on the ThreadPool, invoking
+ for each.
+
+ This method does not block. GetUpdates will be called AFTER the returns
+
+
+ The used for making GetUpdates calls
+ Delegate used for processing s
+ Delegate used for processing polling errors
+ Options used to configure getUpdates request
+
+ The with which you can stop receiving
+
+
+
+
+ Starts receiving s on the ThreadPool, invoking
+ for each.
+
+ This method does not block. GetUpdates will be called AFTER the returns
+
+
+ The used for making GetUpdates calls
+ Delegate used for processing s
+ Delegate used for processing polling errors
+ Options used to configure getUpdates request
+
+ The with which you can stop receiving
+
+
+
+
+ Starts receiving s on the ThreadPool, invoking
+ for each.
+
+ This method does not block. GetUpdates will be called AFTER the
+ returns
+
+
+ The used for making GetUpdates calls
+
+ The used for processing s
+
+ Options used to configure getUpdates request
+
+ The with which you can stop receiving
+
+
+
+
+ Starts receiving s on the ThreadPool, invoking
+ for each.
+
+ This method will block if awaited. GetUpdates will be called AFTER the
+ returns
+
+
+
+ The used for processing s
+
+ The used for making GetUpdates calls
+ Options used to configure getUpdates request
+
+ The with which you can stop receiving
+
+
+ A that will be completed when cancellation will be requested through
+
+
+
+
+
+ Starts receiving s on the ThreadPool, invoking
+ for each.
+
+ This method will block if awaited. GetUpdates will be called AFTER the
+ returns
+
+
+ The used for making GetUpdates calls
+ Delegate used for processing s
+ Delegate used for processing polling errors
+ Options used to configure getUpdates requests
+
+ The with which you can stop receiving
+
+
+ A that will be completed when cancellation will be requested through
+
+
+
+
+
+ Starts receiving s on the ThreadPool, invoking
+ for each.
+
+ This method will block if awaited. GetUpdates will be called AFTER the
+ returns
+
+
+ The used for making GetUpdates calls
+ Delegate used for processing s
+ Delegate used for processing polling errors
+ Options used to configure getUpdates requests
+
+ The with which you can stop receiving
+
+
+ A that will be completed when cancellation will be requested through
+
+
+
+
+
+ Starts receiving s on the ThreadPool, invoking
+ for each.
+
+ This method will block if awaited. GetUpdates will be called AFTER the
+ returns
+
+
+ The used for making GetUpdates calls
+
+ The used for processing s
+
+ Options used to configure getUpdates requests
+
+ The with which you can stop receiving
+
+
+ A that will be completed when cancellation will be requested through
+
+
+
+
+
+ This class is used to provide configuration for
+
+
+
+
+ API token
+
+
+
+
+ Used to change base url to your private bot api server URL. It looks like
+ http://localhost:8081. Path, query and fragment will be omitted if present.
+
+
+
+
+ Indicates that test environment will be used
+
+
+
+
+ Unique identifier for the bot from bot token. For example, for the bot token
+ "1234567:4TT8bAc8GHUspu3ERYn-KGcvsvGB9u_n4ddy", the bot id is "1234567".
+ Token format is not public API so this property is optional and may stop working
+ in the future if Telegram changes it's token format.
+
+
+
+
+ Indicates that local bot server will be used
+
+
+
+
+ Contains base url for downloading files
+
+
+
+
+ Contains base url for making requests
+
+
+
+
+ Create a new instance.
+
+ API token
+
+ Used to change base URL to your private Bot API server URL. It looks like
+ http://localhost:8081. Path, query and fragment will be omitted if present.
+
+
+
+ Thrown if format is invalid
+
+
+ Thrown if format is invalid
+
+
+
+
+ This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).
+
+
+
+
+ Video width as defined by sender
+
+
+
+
+ Video height as defined by sender
+
+
+
+
+ Duration of the video in seconds as defined by sender
+
+
+
+
+ Optional. Animation thumbnail as defined by sender
+
+
+
+
+ Optional. Original animation filename as defined by sender
+
+
+
+
+ Optional. MIME type of the file as defined by sender
+
+
+
+
+ Represents bot API response
+
+ Expected type of operation result
+
+
+
+ Gets a value indicating whether the request was successful.
+
+
+
+
+ Gets the error message.
+
+
+
+
+ Gets the error code.
+
+
+
+
+ Contains information about why a request was unsuccessful.
+
+
+
+
+ Gets the result object.
+
+
+
+
+ Initializes an instance of
+
+ Indicating whether the request was successful
+ Result object
+ Error code
+ Error message
+ Information about why a request was unsuccessful
+
+
+
+ This object represents an audio file to be treated as music by the Telegram clients.
+
+
+
+
+ Duration of the audio in seconds as defined by sender
+
+
+
+
+ Optional. Performer of the audio as defined by sender or by audio tags
+
+
+
+
+ Optional. Title of the audio as defined by sender or by audio tags
+
+
+
+
+ Optional. Original filename as defined by sender
+
+
+
+
+ Optional. MIME type of the file as defined by sender
+
+
+
+
+ Optional. Thumbnail of the album cover to which the music file belongs
+
+
+
+
+ This object represents a bot command
+
+
+
+
+ Text of the command, 1-32 characters. Can contain only lowercase English letters, digits and underscores.
+
+
+
+
+ Description of the command, 3-256 characters.
+
+
+
+
+ This object represents the scope to which bot commands are applied
+
+
+
+
+ Scope type
+
+
+
+
+ Create a default instance
+
+
+
+
+
+ Create a instance for all private chats
+
+
+
+
+
+ Create a instance for all group chats
+
+
+
+
+ Create a instance for all chat administrators
+
+
+
+
+ Create a instance for a specific
+
+
+ Unique identifier for the target or username of the target supergroup
+
+
+
+
+ Create a instance for a specific member in a specific
+
+
+ Unique identifier for the target or username of the target supergroup
+
+
+
+
+ Represents the scope of bot commands, covering a specific member of a group or supergroup chat.
+
+
+ Unique identifier for the target or username of the target supergroup
+
+ Unique identifier of the target user
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Unique identifier for the target or username of the target supergroup
+ (in the format @supergroupusername)
+
+
+
+
+
+
+
+
+
+
+ Unique identifier for the target or username of the target supergroup
+ (in the format @supergroupusername)
+
+
+
+
+
+
+
+
+
+
+ Unique identifier for the target or username of the target supergroup
+ (in the format @supergroupusername)
+
+
+
+
+ Unique identifier of the target user
+
+
+
+
+ This object represents the bot's description.
+
+
+
+
+ The bot's description
+
+
+
+
+ This object represents the bot's name.
+
+
+
+
+ The bot's name
+
+
+
+
+ This object represents the bot's short description.
+
+
+
+
+ The bot's short description
+
+
+
+
+ A placeholder, currently holds no information. Use @BotFather
+ to set up your game.
+
+
+
+
+ This object represents an incoming callback query from a callback button in an
+ inline keyboard. If the button that originated the query was attached to
+ a message sent by the bot, the field will be present. If the button was attached to a
+ message sent via the bot (in inline mode), the field will be present. Exactly one
+ of the fields data or will be present.
+
+
+ NOTE: After the user presses a callback button, Telegram clients will display a progress bar until
+ you call . It is, therefore, necessary to react by calling
+ even if no notification to the user is needed (e.g., without
+ specifying any of the optional parameters).
+
+
+
+
+ Unique identifier for this query
+
+
+
+
+ Sender
+
+
+
+
+ Optional. Description with the callback button that originated the query. Note that message content and
+ message date will not be available if the message is too old
+
+
+
+
+ Optional. Identifier of the message sent via the bot in inline mode, that originated the query
+
+
+
+
+ Global identifier, uniquely corresponding to the chat to which the message with the callback button was
+ sent. Useful for high scores in games.
+
+
+
+
+ Optional. Data associated with the callback button.
+
+
+ Be aware that a bad client can send arbitrary data in this field.
+
+
+
+
+ Optional. Short name of a to be returned, serves as the unique identifier for the game.
+
+
+
+
+ Indicates if the User requests a Game
+
+
+
+
+ This object represents a chat.
+
+
+
+
+ Unique identifier for this chat. This number may have more
+ than 32 significant bits and some programming languages may have
+ difficulty/silent defects in interpreting it. But it has
+ at most 52 significant bits, so a signed 64-bit integer
+ or double-precision float type are safe for storing this identifier.
+
+
+
+
+ Type of chat, can be either “private”, “group”, “supergroup” or “channel”
+
+
+
+
+ Optional. Title, for supergroups, channels and group chats
+
+
+
+
+ Optional. Username, for private chats, supergroups and channels if available
+
+
+
+
+ Optional. First name of the other party in a private chat
+
+
+
+
+ Optional. Last name of the other party in a private chat
+
+
+
+
+ Optional. , if the supergroup chat is a forum (has topics enabled)
+
+
+
+
+ Optional. Chat photo. Returned only in .
+
+
+
+
+ Optional. If non-empty, the list of all active chat usernames; for private chats, supergroups and channels.
+ Returned only in .
+
+
+
+
+ Optional. Custom emoji identifier of emoji status of the other party in a private chat.
+ Returned only in .
+
+
+
+
+ Optional. Bio of the other party in a private chat. Returned only in .
+
+
+
+
+ Optional. , if privacy settings of the other party in the private chat allows to use
+ tg://user?id=<user_id> links only in chats with the user.
+ Returned only in .
+
+
+
+
+ Optional. , if the privacy settings of the other party restrict sending voice
+ and video note messages in the private chat.
+ Returned only in .
+
+
+
+
+ Optional. , if users need to join the supergroup before they can send messages.
+ Returned only in .
+
+
+
+
+ Optional. , if all users directly joining the supergroup need to be approved by supergroup administrators.
+ Returned only in .
+
+
+
+
+ Optional. Description, for groups, supergroups and channel chats.
+ Returned only in .
+
+
+
+
+ Optional. Primary invite link, for groups, supergroups and channel chats.
+ Returned only in .
+
+
+
+
+ Optional. The most recent pinned message (by sending date).
+ Returned only in .
+
+
+
+
+ Optional. Default chat member permissions, for groups and supergroups.
+ Returned only in .
+
+
+
+
+ Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each
+ unpriviledged user. Returned only in .
+
+
+
+
+ Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds.
+ Returned only in .
+
+
+
+
+ Optional. , if aggressive anti-spam checks are enabled in the supergroup. The field is
+ only available to chat administrators. Returned only in .
+
+
+
+
+ Optional. , if non-administrators can only get the list of bots and administrators in
+ the chat. Returned only in .
+
+
+
+
+ Optional. , if messages from the chat can't be forwarded to other chats.
+ Returned only in .
+
+
+
+
+ Optional. For supergroups, name of group sticker set.
+ Returned only in .
+
+
+
+
+ Optional. True, if the bot can change the group sticker set.
+ Returned only in .
+
+
+
+
+ Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel
+ and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some
+ programming languages may have difficulty/silent defects in interpreting it. But it is smaller than
+ 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
+ Returned only in .
+
+
+
+
+ Optional. For supergroups, the location to which the supergroup is connected.
+ Returned only in .
+
+
+
+
+ Represents the rights of an administrator in a chat.
+
+
+
+
+ , if the user's presence in the chat is hidden
+
+
+
+
+ , if the administrator can access the chat event log, chat statistics, message statistics in
+ channels, see channel members, see anonymous administrators in supergroups and ignore slow mode.
+ Implied by any other administrator privilege
+
+
+
+
+ , if the administrator can delete messages of other users
+
+
+
+
+ , if the administrator can manage video chats
+
+
+
+
+ , if the administrator can restrict, ban or unban chat members
+
+
+
+
+ , if the administrator can add new administrators with a subset of their own privileges or demote
+ administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed
+ by the user)
+
+
+
+
+ , if the user is allowed to change the chat title, photo and other settings
+
+
+
+
+ , if the user is allowed to invite new users to the chat
+
+
+
+
+ Optional. , if the administrator can post in the channel; channels only
+
+
+
+
+ Optional. , if the administrator can edit messages of other users and can pin messages;
+ channels only
+
+
+
+
+ Optional. , if the user is allowed to pin messages; groups and supergroups only
+
+
+
+
+ Optional. , if the user is allowed to create, rename, close, and reopen forum topics; supergroups only
+
+
+
+
+ Represents a ChatId
+
+
+
+
+ Unique identifier for the chat
+
+
+
+
+ Username of the supergroup or channel (in the format @channelusername)
+
+
+
+
+ Create a using unique identifier for the chat
+
+ Unique identifier for the chat
+
+
+
+ Create a using unique identifier for the chat or username of
+ the supergroup or channel (in the format @channelusername)
+
+ Unique identifier for the chat or username of
+ the supergroup or channel (in the format @channelusername)
+
+ Thrown when string value isn`t number and doesn't start with @
+
+ Thrown when string value is null
+
+
+
+ Determines whether the specified object is equal to the current object.
+
+ The object to compare with the current object.
+ true if the specified object is equal to the current object; otherwise, false.
+
+
+
+
+
+
+ Gets the hash code of this object
+
+ A hash code for the current object.
+
+
+
+ Create a string out of a
+
+ The as string
+
+
+
+ Create a using unique identifier for the chat
+
+ Unique identifier for the chat
+
+
+
+ Create a using unique identifier for the chat or username of
+ the supergroup or channel (in the format @channelusername)
+
+ Unique identifier for the chat or username of
+ the supergroup or channel (in the format @channelusername)
+
+ Thrown when string value isn`t number and doesn't start with @
+
+ Thrown when string value is null
+
+
+
+ Convert a Chat Object to a
+
+
+
+
+
+ Compares two ChatId objects
+
+
+
+
+ Compares two ChatId objects
+
+
+
+
+
+
+
+ Represents an invite link for a chat.
+
+
+
+
+ The invite link. If the link was created by another chat administrator, then the second part of the
+ link will be replaced with “…”.
+
+
+
+
+ Creator of the link
+
+
+
+
+ , if users joining the chat via the link need to be approved by chat administrators
+
+
+
+
+ , if the link is primary
+
+
+
+
+ , if the link is revoked
+
+
+
+
+ Optional. Invite link name
+
+
+
+
+ Optional. Point in time when the link will expire or has been expired
+
+
+
+
+ Optional. Maximum number of users that can be members of the chat simultaneously after joining the chat
+ via this invite link; 1-99999
+
+
+
+
+ Optional. Number of pending join requests created using this link
+
+
+
+
+ Represents a join request sent to a chat.
+
+
+
+
+ Chat to which the request was sent
+
+
+
+
+ User that sent the join request
+
+
+
+
+ Identifier of a private chat with the user who sent the join request. This number may have more than 32
+ significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it
+ has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this
+ identifier. The bot can use this identifier for 24 hours to send messages until the join request is processed,
+ assuming no other administrator contacted the user.
+
+
+
+
+ Date the request was sent
+
+
+
+
+ Optional. Bio of the user
+
+
+
+
+ Optional. Chat invite link that was used by the user to send the join request
+
+
+
+
+ Represents a location to which a chat is connected.
+
+
+
+
+ The location to which the supergroup is connected. Can't be a live location.
+
+
+
+
+ Location address; 1-64 characters, as defined by the chat owner
+
+
+
+
+ This object contains information about one member of the chat.
+
+
+
+
+ The member's status in the chat.
+
+
+
+
+ Information about the user
+
+
+
+
+ Represents a that owns the chat and has all administrator privileges
+
+
+
+
+
+
+
+ Custom title for this user
+
+
+
+
+ , if the user's presence in the chat is hidden
+
+
+
+
+ Represents a that has some additional privileges
+
+
+
+
+
+
+
+ , if the bot is allowed to edit administrator privileges of that user
+
+
+
+
+ Custom title for this user
+
+
+
+
+ , if the user's presence in the chat is hidden
+
+
+
+
+ , if the administrator can access the chat event log, chat statistics, message statistics
+ in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode.
+ Implied by any other administrator privilege
+
+
+
+
+ , if the administrator can post in the channel, channels only
+
+
+
+
+ , if the administrator can edit messages of other users, channels only
+
+
+
+
+ , if the administrator can delete messages of other users
+
+
+
+
+ , if the administrator can manage video chats
+
+
+
+
+ , if the administrator can restrict, ban or unban chat members
+
+
+
+
+ , if the administrator can add new administrators with a subset of his own privileges or
+ demote administrators that he has promoted, directly or indirectly (promoted by administrators that
+ were appointed by the user)
+
+
+
+
+ , if the administrator can change the chat title, photo and other settings
+
+
+
+
+ , if the administrator can invite new users to the chat
+
+
+
+
+ , if the administrator can pin messages, supergroups only
+
+
+
+
+ Optional. , if the user is allowed to create, rename, close, and reopen forum topics;
+ supergroups only
+
+
+
+
+ Represents a that has no additional privileges or restrictions.
+
+
+
+
+
+
+
+ Represents a that is under certain restrictions in the chat. Supergroups only.
+
+
+
+
+
+
+
+ , if the user is a member of the chat at the moment of the request
+
+
+
+
+ , if the user can change the chat title, photo and other settings
+
+
+
+
+ , if the user can invite new users to the chat
+
+
+
+
+ , if the user can pin messages, supergroups only
+
+
+
+
+ , if the user can send text messages, contacts, locations and venues
+
+
+
+
+ , if the user is allowed to send audios
+
+
+
+
+ , if the user is allowed to send documents
+
+
+
+
+ , if the user is allowed to send photos
+
+
+
+
+ , if the user is allowed to send videos
+
+
+
+
+ , if the user is allowed to send video notes
+
+
+
+
+ , if the user is allowed to send voice notes
+
+
+
+
+ , if the user is allowed to send polls
+
+
+
+
+ , if the user is allowed to send animations, games, stickers and use inline bots
+
+
+
+
+ , if the user is allowed to add web page previews to their messages
+
+
+
+
+ Date when restrictions will be lifted for this user, UTC time
+
+
+
+
+ Optional. , if the user is allowed to create forum topics
+ supergroups only
+
+
+
+
+ Represents a that isn't currently a member of the chat, but may join it themselves
+
+
+
+
+
+
+
+ Represents a that was banned in the chat and can't return to the chat
+ or view chat messages
+
+
+
+
+
+
+
+ Date when restrictions will be lifted for this user, UTC time
+
+
+
+
+ This object represents changes in the status of a chat member.
+
+
+
+
+ Chat the user belongs to
+
+
+
+
+ Performer of the action, which resulted in the change
+
+
+
+
+ Date the change was done
+
+
+
+
+ Previous information about the chat member
+
+
+
+
+ New information about the chat member
+
+
+
+
+ Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link
+ events only.
+
+
+
+
+ Optional. , if the user joined the chat via a chat folder invite link
+
+
+
+
+ Describes actions that a non-administrator user is allowed to take in a chat.
+
+
+
+
+ Optional. , if the user is allowed to send text messages, contacts, locations and venues
+
+
+
+
+ Optional. , if the user is allowed to send audios
+
+
+
+
+ Optional. , if the user is allowed to send documents
+
+
+
+
+ Optional. , if the user is allowed to send photos
+
+
+
+
+ Optional. , if the user is allowed to send videos
+
+
+
+
+ Optional. , if the user is allowed to send video notes
+
+
+
+
+ Optional. , if the user is allowed to send voice notes
+
+
+
+
+ Optional. , if the user is allowed to send polls, implies
+
+
+
+
+ Optional. , if the user is allowed to send animations, games, stickers and use inline
+ bots
+
+
+
+
+ Optional. , if the user is allowed to add web page previews to their messages
+
+
+
+
+ Optional. , if the user is allowed to change the chat title, photo and other settings.
+ Ignored in public supergroups
+
+
+
+
+ Optional. , if the user is allowed to invite new users to the chat
+
+
+
+
+ Optional. , if the user is allowed to pin messages. Ignored in public supergroups
+
+
+
+
+ Optional. , if the user is allowed to create forum topics.
+ If omitted defaults to the value of
+ supergroups only
+
+
+
+
+ Collection of fileIds of profile pictures of a chat.
+
+
+
+
+ File identifier of small (160x160) chat photo. This FileId can be used only for photo download and only
+ for as long as the photo is not changed.
+
+
+
+
+ Unique file identifier of small (160x160) chat photo, which is supposed to be the same over time and for
+ different bots. Can't be used to download or reuse the file.
+
+
+
+
+ File identifier of big (640x640) chat photo. This FileId can be used only for photo download and only for
+ as long as the photo is not changed.
+
+
+
+
+ Unique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for
+ different bots. Can't be used to download or reuse the file.
+
+
+
+
+ This object contains information about the chat whose identifier was shared with the bot using a
+ button.
+
+
+
+
+ Identifier of the request
+
+
+
+
+ Identifier of the shared chat. This number may have more than 32 significant bits and some programming
+ languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits,
+ so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have
+ access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by
+ some other means.
+
+
+
+
+ This object represents a result of an that was chosen by the
+ and sent to their chat partner.
+
+
+
+
+ The unique identifier for the result that was chosen.
+
+
+
+
+ The user that chose the result.
+
+
+
+
+ Optional. Sender location, only for bots that require user location
+
+
+
+
+ Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached
+ to the message. Will be also received in callback queries and can be used to edit the message.
+
+
+
+
+ The query that was used to obtain the result.
+
+
+
+
+ Represent a color in RGB space
+
+
+
+
+ Red component
+
+
+
+
+ Green component
+
+
+
+
+ Blue component
+
+
+
+
+ Instantiate a new color value
+
+ Red component
+ Green component
+ Blue component
+
+
+
+ Instantiate a new color value
+
+ Red component
+ Green component
+ Blue component
+
+
+
+ Instantiate a new color value
+
+ Numeric value of color in RGB space
+
+
+
+
+ Instantiate a new color value
+
+ Numeric value of color in RGB space
+
+
+
+
+
+
+
+ Convert current instance to its numeric representation
+
+ Numeric representation of current color
+
+
+
+ Convert current instance to its numeric representation
+
+ Numeric representation of current color
+
+
+
+ Convert current instance to its representation
+
+
+
+
+
+ Deconstruct current instance of into its RGB components
+
+
+
+
+
+
+
+ Convert current instance to its numeric representation
+
+
+ Numeric representation of the current
+
+
+
+ Convert current instance to its numeric representation
+
+
+ Numeric representation of the current
+
+
+
+ Convert current instance to its representation
+
+
+ representation of the current
+
+
+
+ Blue color
+
+
+
+
+ Yellow color
+
+
+
+
+ Violet color
+
+
+
+
+ Green color
+
+
+
+
+ Pink color
+
+
+
+
+ Red color
+
+
+
+
+
+ Thrown if is out of byte range
+
+
+
+
+
+ This object represents a phone contact.
+
+
+
+
+ Contact's phone number
+
+
+
+
+ Contact's first name
+
+
+
+
+ Optional. Contact's last name
+
+
+
+
+ Optional. Contact's user identifier in Telegram
+
+
+
+
+ Optional. Additional data about the contact in the form of a vCard
+
+
+
+
+ This object represents a dice with random value
+
+
+
+
+ Emoji on which the dice throw animation is based
+
+
+
+
+ Value of the dice, 1-6 for (“🎲”),
+ (“🎯”) and ("🎳"), 1-5 for (“🏀”) and
+ ("⚽"), and values 1-64 for ("🎰"). Defaults to
+ (“🎲”)
+
+
+
+
+ This object represents a general file (as opposed to photos, voice messages and audio files).
+
+
+
+
+ Optional. Document thumbnail as defined by sender
+
+
+
+
+ Optional. Original filename as defined by sender
+
+
+
+
+ Optional. MIME type of the file as defined by sender
+
+
+
+
+ Scope type
+
+
+
+
+ Represents the default of bot commands. Default commands are used if no
+ commands with a narrower are specified for the user.
+
+
+
+
+ Represents the of bot commands, covering all private chats.
+
+
+
+
+ Represents the of bot commands, covering all group and supergroup chats.
+
+
+
+
+ Represents the of bot commands, covering all group and supergroup
+ chat administrators.
+
+
+
+
+ Represents the of bot commands, covering a specific .
+
+
+
+
+ Represents the of bot commands, covering all administrators of
+ a specific group or supergroup .
+
+
+
+
+ Represents the of bot commands, covering a specific member of
+ a group or supergroup .
+
+
+
+
+ Type of action to broadcast
+
+
+
+
+ Typing
+
+
+
+
+ Uploading a
+
+
+
+
+ Recording a
+
+
+
+
+ Uploading a
+
+
+
+
+ Recording a
+
+
+
+
+ Uploading a
+
+
+
+
+ Uploading a
+
+
+
+
+ Finding a
+
+
+
+
+ Recording a
+
+
+
+
+ Uploading a
+
+
+
+
+ Choosing a
+
+
+
+
+ ChatMember status
+
+
+
+
+ Creator of the
+
+
+
+
+ Administrator of the
+
+
+
+
+ Normal member of the
+
+
+
+
+ A who left the
+
+
+
+
+ A who was kicked from the
+
+
+
+
+ A who is restricted in the
+
+
+
+
+ Type of the , from which the inline query was sent
+
+
+
+
+ Normal one to one
+
+
+
+
+ Normal group chat
+
+
+
+
+ A channel
+
+
+
+
+ A supergroup
+
+
+
+
+ “sender” for a private chat with the inline query sender
+
+
+
+
+ Emoji on which the dice throw animation is based
+
+ This enum is used only in the library APIs and is not present in types that are coming from
+ Telegram servers for compatibility reasons
+
+
+
+
+
+ Dice. Resulting value is 1-6
+
+
+
+
+ Darts. Resulting value is 1-6
+
+
+
+
+ Basketball. Resulting value is 1-5
+
+
+
+
+ Football. Resulting value is 1-5
+
+
+
+
+ Slot machine. Resulting value is 1-64
+
+
+
+
+ Bowling. Result value is 1-6
+
+
+
+
+ Type of a
+
+
+
+
+ FileStream
+
+
+
+
+ FileId
+
+
+
+
+ File URL
+
+
+
+
+ Type of the input media
+
+
+
+
+ Photo
+
+
+
+
+ Video
+
+
+
+
+ Animation
+
+
+
+
+ Audio
+
+
+
+
+ Document
+
+
+
+
+ The part of the face relative to which the mask should be placed.
+
+
+
+
+ The forehead
+
+
+
+
+ The eyes
+
+
+
+
+ The mouth
+
+
+
+
+ The chin
+
+
+
+
+ Type of the
+
+
+
+
+ Describes that no specific value for the menu button was set.
+
+
+
+
+ Represents a menu button, which opens the bot’s list of commands.
+
+
+
+
+ Represents a menu button, which launches a Web App.
+
+
+
+
+ Type of a
+
+
+
+
+ A mentioned
+
+
+
+
+ A searchable Hashtag
+
+
+
+
+ A Bot command
+
+
+
+
+ An URL
+
+
+
+
+ An email
+
+
+
+
+ Bold text
+
+
+
+
+ Italic text
+
+
+
+
+ Monowidth string
+
+
+
+
+ Monowidth block
+
+
+
+
+ Clickable text URLs
+
+
+
+
+ Mentions for a without
+
+
+
+
+ Phone number
+
+
+
+
+ A cashtag (e.g. $EUR, $USD) - $ followed by the short currency code
+
+
+
+
+ Underlined text
+
+
+
+
+ Strikethrough text
+
+
+
+
+ Spoiler message
+
+
+
+
+ Inline custom emoji stickers
+
+
+
+
+ The type of a
+
+
+
+
+ The is unknown
+
+
+
+
+ The contains text
+
+
+
+
+ The contains a
+
+
+
+
+ The contains an
+
+
+
+
+ The contains a
+
+
+
+
+ The contains a
+
+
+
+
+ The contains a
+
+
+
+
+ The contains a
+
+
+
+
+ The contains a
+
+
+
+
+ The contains a
+
+
+
+
+ The contains a
+
+
+
+
+ The contains a
+
+
+
+
+ The contains a
+
+
+
+
+ The contains a
+
+
+
+
+ The contains a
+
+
+
+
+ The contains a
+
+
+
+
+ The contains a
+
+
+
+
+ The contains a
+
+
+
+
+ The contains a
+
+
+
+
+ The contains a
+
+
+
+
+ The contains a
+
+
+
+
+ The contains a
+
+
+
+
+ The contains a
+
+
+
+
+ The contains a
+
+
+
+
+ The contains a
+
+
+
+
+ The contains non-default
+
+
+
+
+ The contains non-default
+
+
+
+
+ The contains
+
+
+
+
+ The contains
+
+
+
+
+ The contains
+
+
+
+
+ The contains
+
+
+
+
+ The contains
+
+
+
+
+ The contains
+
+
+
+
+ The contains
+
+
+
+
+ The contains
+
+
+
+
+ The contains
+
+
+
+
+ The contains
+
+
+
+
+ The contains
+
+
+
+
+ The contains
+
+
+
+
+ The contains
+
+
+
+
+ The contains
+
+
+
+
+ The contains
+
+
+
+
+ The contains
+
+
+
+
+ The contains
+
+
+
+
+ The contains
+
+
+
+
+ The contains
+
+
+
+
+
+ Text parsing mode
+
+
+ The Bot API supports basic formatting for messages. You can use bold and italic text, as well as inline
+ links and pre-formatted code in your bots' messages. Telegram clients will render them accordingly.
+ You can use either markdown-style or HTML-style formatting.
+
+
+
+
+
+
+ Markdown-formatted A
+
+
+ This is a legacy mode, retained for backward compatibility
+
+
+
+
+ HTML-formatted
+
+
+
+
+ MarkdownV2-formatted
+
+
+
+
+ type
+
+ This enum is used only in the library APIs and is not present in types that are coming from
+ Telegram servers for compatibility reasons
+
+
+
+
+
+ Regular poll
+
+
+
+
+ Quiz
+
+
+
+
+ Format of the
+
+
+
+
+ Static
+
+
+
+
+ Animated
+
+
+
+
+ Video
+
+
+
+
+ Type of the
+
+
+
+
+ Regular
+
+
+
+
+ Mask
+
+
+
+
+ Custom emoji
+
+
+
+
+ The type of an
+
+
+
+
+ Update Type is unknown
+
+
+
+
+ The contains a .
+
+
+
+
+ The contains an .
+
+
+
+
+ The contains a .
+
+
+
+
+ The contains a
+
+
+
+
+ The contains an edited
+
+
+
+
+ The contains a channel post
+
+
+
+
+ The contains an edited channel post
+
+
+
+
+ The contains an
+
+
+
+
+ The contains an
+
+
+
+
+ The contains an
+
+
+
+
+ The contains an
+
+
+
+
+ The contains an
+
+
+
+
+ The contains an
+
+
+
+
+ The contains an
+
+
+
+
+ This object represents a file ready to be downloaded. The file can be downloaded via .
+ It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling .
+
+
+
+
+ Optional. File path. Use to get the file.
+
+
+
+
+ This object represents a file ready to be downloaded. The file can be downloaded via
+ . It is guaranteed that the link will be valid for
+ at least 1 hour. When the link expires, a new one can be requested by calling
+ .
+
+
+
+
+ Identifier for this file, which can be used to download or reuse the file
+
+
+
+
+ Unique identifier for this file, which is supposed to be the same over time and for different bots.
+ Can't be used to download or reuse the file.
+
+
+
+
+ Optional. File size
+
+
+
+
+ This object represents a forum topic.
+
+
+
+
+ Unique identifier of the forum topic
+
+
+
+
+ Name of the topic
+
+
+
+
+ Color of the topic icon in RGB format
+
+
+
+
+ Optional. Unique identifier of the custom emoji shown as the topic icon
+
+
+
+
+ This object represents a service message about a forum topic closed in the chat. Currently holds no information.
+
+
+
+
+ This object represents a service message about a new forum topic created in the chat.
+
+
+
+
+ Name of the topic
+
+
+
+
+ Color of the topic icon in RGB format
+
+
+
+
+ Optional. Unique identifier of the custom emoji shown as the topic icon
+
+
+
+
+ This object represents a service message about an edited forum topic.
+
+
+
+
+ Optional. New name of the topic, if it was edited
+
+
+
+
+ Optional. New identifier of the custom emoji shown as the topic icon, if it was edited; an empty string if the icon was removed
+
+
+
+
+ This object represents a service message about a forum topic reopened in the chat. Currently holds no information.
+
+
+
+
+ This object represents a game. Use BotFather to create and edit games, their short names will act as unique
+ identifiers.
+
+
+
+
+ Title of the game.
+
+
+
+
+ Description of the game.
+
+
+
+
+ Photo that will be displayed in the game message in chats.
+
+
+
+
+ Optional. Brief description of the game or high scores included in the game message. Can be automatically
+ edited to include current high scores for the game when the bot calls
+ , or manually edited using
+ . 0-4096 characters.
+
+
+
+
+ Optional. Special entities that appear in text, such as usernames, URLs, bot commands, etc.
+
+
+
+
+ Optional. Animation that will be displayed in the game message in chats. Upload via
+ @BotFather
+
+
+
+
+ This object represents one row of the high scores table for a game.
+
+
+
+
+ Position in high score table for the game.
+
+
+
+
+ User
+
+
+
+
+ Score
+
+
+
+
+ This object represents a service message about General forum topic hidden in the chat.
+ Currently holds no information.
+
+
+
+
+ This object represents a service message about General forum topic unhidden in the chat.
+ Currently holds no information.
+
+
+
+
+ This object represents an incoming inline query. When the user sends an empty query, your bot could return
+ some default or trending results.
+
+
+
+
+ Unique identifier for this query
+
+
+
+
+ Sender
+
+
+
+
+ Text of the query (up to 256 characters)
+
+
+
+
+ Offset of the results to be returned, can be controlled by the bot
+
+
+
+
+ Optional. Type of the chat, from which the inline query was sent. Can be either for
+ a private chat with the inline query sender, , ,
+ , or . The chat type should be always known for requests
+ sent from official clients and most third-party clients, unless the request was sent from a secret chat
+
+
+
+
+ Optional. Sender location, only for bots that request user location
+
+
+
+
+ Content of the message to be sent instead of the result
+
+
+
+
+ Caption of the result to be sent, 0-1024 characters after entities parsing
+
+
+
+
+ Mode for parsing entities in the result caption. See
+ formatting options
+ for more details.
+
+
+
+
+ List of special entities that appear in the caption, which can be specified
+ instead of
+
+
+
+
+ Location latitude in degrees
+
+
+
+
+ Location longitude in degrees
+
+
+
+
+ Thumbnail width
+
+
+
+
+ Thumbnail height
+
+
+
+
+ Url of the thumbnail for the result
+
+
+
+
+ Base Class for inline results send in response to an
+
+
+
+
+ Type of the result
+
+
+
+
+ Unique identifier for this result, 1-64 Bytes
+
+
+
+
+ Optional. Inline keyboard attached to the message
+
+
+
+
+ Initializes a new inline query result
+
+ Unique identifier for this result, 1-64 Bytes
+
+
+
+ Represents a link to an article or web page.
+
+
+
+
+ Type of the result, must be article
+
+
+
+
+ Title of the result
+
+
+
+
+ Content of the message to be sent
+
+
+
+
+ Optional. URL of the result.
+
+
+
+
+ Optional. Pass , if you don't want the URL to be shown in the message.
+
+
+
+
+ Optional. Short description of the result.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new object
+
+ Unique identifier of this result
+ Title of the result
+ Content of the message to be sent
+
+
+
+ Represents a link to an MP3 audio file. By default, this audio file will be sent by the user.
+ Alternatively, you can use to send
+ a message with the specified content instead of the audio.
+
+
+
+
+ Type of the result, must be audio
+
+
+
+
+ A valid URL for the audio file
+
+
+
+
+ Title
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Optional. Performer
+
+
+
+
+ Optional. Audio duration in seconds
+
+
+
+
+
+
+
+ Initializes a new inline query result
+
+ Unique identifier of this result
+ A valid URL for the audio file
+ Title of the result
+
+
+
+ Represents a link to an MP3 audio file stored on the Telegram servers. By default, this audio
+ file will be sent by the user. Alternatively, you can use
+ to send a message with the
+ specified content instead of the audio.
+
+
+
+
+ Type of the result, must be audio
+
+
+
+
+ A valid file identifier for the audio file
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new inline query result
+
+ Unique identifier of this result
+ A valid file identifier for the audio file
+
+
+
+ Represents a link to a file stored on the Telegram servers. By default, this file will be sent
+ by the user with an optional caption. Alternatively, you can use
+ to send a message with the
+ specified content instead of the file.
+
+
+
+
+ Type of the result, must be document
+
+
+
+
+ Title for the result
+
+
+
+
+ A valid file identifier for the file
+
+
+
+
+ Optional. Short description of the result
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new inline query result
+
+ Unique identifier of this result
+ A valid file identifier for the file
+ Title of the result
+
+
+
+ Represents a link to an animated GIF file stored on the Telegram servers. By default, this
+ animated GIF file will be sent by the user with an optional caption. Alternatively, you can
+ use to send a message with
+ specified content instead of the animation.
+
+
+
+
+ Type of the result, must be GIF
+
+
+
+
+ A valid file identifier for the GIF file
+
+
+
+
+ Optional. Title for the result
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new inline query result
+
+ Unique identifier of this result
+ A valid file identifier for the GIF file
+
+
+
+ Represents a link to a video animation (H.264/MPEG-4 AVC video without sound) stored on the
+ Telegram servers. By default, this animated MPEG-4 file will be sent by the user with an
+ optional caption. Alternatively, you can use
+ to send a message with
+ the specified content instead of the animation.
+
+
+
+
+ Type of the result, must be mpeg4_gif
+
+
+
+
+ A valid file identifier for the MP4 file
+
+
+
+
+ Optional. Title for the result
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new inline query result
+
+ Unique identifier of this result
+ A valid file identifier for the MP4 file
+
+
+
+ Represents a link to a photo stored on the Telegram servers. By default, this photo will be sent
+ by the user with an optional caption. Alternatively, you can use
+ to send a message with the
+ specified content instead of the photo.
+
+
+
+
+ Type of the result, must be photo
+
+
+
+
+ A valid file identifier of the photo
+
+
+
+
+ Optional. Title for the result
+
+
+
+
+ Optional. Short description of the result
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new inline query result
+
+ Unique identifier of this result
+ A valid file identifier of the photo
+
+
+
+ Represents a link to a sticker stored on the Telegram servers. By default, this sticker will
+ be sent by the user. Alternatively, you can use
+ to send a message with
+ the specified content instead of the sticker.
+
+
+
+
+ Type of the result, must be sticker
+
+
+
+
+ A valid file identifier of the sticker
+
+
+
+
+
+
+
+ Initializes a new inline query result
+
+ Unique identifier of this result
+ A valid file identifier of the sticker
+
+
+
+ Represents a link to a video file stored on the Telegram servers. By default, this video file will
+ be sent by the user with an optional caption. Alternatively, you can use
+ to send a message with
+ the specified content instead of the video.
+
+
+
+
+ Type of the result, must be video
+
+
+
+
+ A valid file identifier for the video file
+
+
+
+
+ Title for the result
+
+
+
+
+ Optional. Short description of the result
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new inline query result
+
+ Unique identifier of this result
+ A valid file identifier for the video file
+ Title of the result
+
+
+
+ Represents a link to a voice message stored on the Telegram servers. By default, this voice
+ message will be sent by the user. Alternatively, you can use
+ to send a message
+ with the specified content instead of the voice message.
+
+
+
+
+ Type of the result, must be voice
+
+
+
+
+ A valid file identifier for the voice message
+
+
+
+
+ Voice message title
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new inline query result
+
+ Unique identifier of this result
+ A valid file identifier for the voice message
+ Title of the result
+
+
+
+ Represents a contact with a phone number. By default, this contact will be sent by the user.
+ Alternatively, you can use to send
+ a message with the specified content instead of the contact.
+
+
+
+
+ Type of the result, must be contact
+
+
+
+
+ Contact's phone number
+
+
+
+
+ Contact's first name
+
+
+
+
+ Optional. Contact's last name
+
+
+
+
+ Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new inline query result
+
+ Unique identifier of this result
+ Contact's phone number
+ Contact's first name
+
+
+
+ Represents a link to a file. By default, this file will be sent by the user with an optional caption.
+ Alternatively, you can use to send
+ a message with the specified content instead of the file. Currently, only .PDF and .ZIP files
+ can be sent using this method.
+
+
+
+
+ Type of the result, must be document
+
+
+
+
+ Title for the result
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A valid URL for the file
+
+
+
+
+ Mime type of the content of the file, either “application/pdf” or “application/zip”
+
+
+
+
+ Optional. Short description of the result
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new inline query result
+
+ Unique identifier of this result
+ A valid URL for the file
+ Title of the result
+
+ Mime type of the content of the file, either “application/pdf” or “application/zip”
+
+
+
+
+ Represents a .
+
+
+
+
+ Type of the result, must be game
+
+
+
+
+ Short name of the game
+
+
+
+
+ Initializes a new inline query result
+
+ Unique identifier of this result
+ Short name of the game
+
+
+
+ Represents a link to an animated GIF file. By default, this animated GIF file will be sent by the
+ user with optional caption. Alternatively, you can use
+ to send a message with the
+ specified content instead of the animation.
+
+
+
+
+ Type of the result, must be GIF
+
+
+
+
+ A valid URL for the GIF file. File size must not exceed 1MB
+
+
+
+
+ Optional. Width of the GIF.
+
+
+
+
+ Optional. Height of the GIF.
+
+
+
+
+ Optional. Duration of the GIF.
+
+
+
+
+ URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result
+
+
+
+
+ Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”,
+ or “video/mp4”. Defaults to “image/jpeg”
+
+
+
+
+ Optional. Title for the result
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new inline query result
+
+ Unique identifier of this result
+ Width of the GIF
+ Url of the thumbnail for the result.
+
+
+
+ Represents a location on a map. By default, the location will be sent by the user. Alternatively,
+ you can use to send a message with
+ the specified content instead of the location.
+
+
+
+
+ Type of the result, must be location
+
+
+
+
+
+
+
+
+
+
+ Location title
+
+
+
+
+ Optional. The radius of uncertainty for the location, measured in meters; 0-1500
+
+
+
+
+ Optional. Period in seconds for which the location can be updated, should be between 60 and 86400.
+
+
+
+
+ Optional. For live locations, a direction in which the user is moving, in degrees.
+ Must be between 1 and 360 if specified.
+
+
+
+
+ Optional. For live locations, a maximum distance for proximity alerts about approaching
+ another chat member, in meters. Must be between 1 and 100000 if specified.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new inline query result
+
+ Unique identifier of this result
+ Latitude of the location in degrees
+ Longitude of the location in degrees
+ Title of the result
+
+
+
+ Represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default, this
+ animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you can use
+ to send a message with the specified
+ content instead of the animation.
+
+
+
+
+ Type of the result, must be mpeg4_gif
+
+
+
+
+ A valid URL for the MP4 file. File size must not exceed 1MB
+
+
+
+
+ Optional. Video width
+
+
+
+
+ Optional. Video height
+
+
+
+
+ Optional. Video duration
+
+
+
+
+ URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result
+
+
+
+
+ Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”,
+ or “video/mp4”. Defaults to “image/jpeg”
+
+
+
+
+ Optional. Title for the result
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new inline query result
+
+ Unique identifier of this result
+ A valid URL for the MP4 file. File size must not exceed 1MB.
+ Url of the thumbnail for the result.
+
+
+
+ Represents a link to a photo. By default, this photo will be sent by the user with optional caption.
+ Alternatively, you can use to send a message
+ with the specified content instead of the photo.
+
+
+
+
+ Type of the result, must be photo
+
+
+
+
+ A valid URL of the photo. Photo must be in jpeg format. Photo size must not exceed 5MB
+
+
+
+
+
+
+
+ Optional. Width of the photo
+
+
+
+
+ Optional. Height of the photo
+
+
+
+
+ Optional. Title for the result
+
+
+
+
+ Optional. Short description of the result
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new inline query representing a link to a photo
+
+ Unique identifier of this result
+ A valid URL of the photo. Photo size must not exceed 5MB.
+ Optional. Url of the thumbnail for the result.
+
+
+
+ This object represents a button to be shown above inline query results.
+ You must use exactly one of the optional fields.
+
+
+
+
+ Label text on the button
+
+
+
+
+ Optional. Description of the Web App that will be launched when the user presses
+ the button. The Web App will be able to switch back to the inline mode using
+ the method switchInlineQuery
+ inside the Web App.
+
+
+
+
+ Optional. Deep-linking parameter
+ for the /start message sent to the bot when a user presses the button.
+ 1-64 characters, only A-Z, a-z, 0-9, _ and - are allowed.
+
+
+ Example: An inline bot that sends YouTube videos can ask the user to connect the bot to their YouTube account
+ to adapt search results accordingly. To do this, it displays a 'Connect your YouTube account' button above
+ the results, or even before showing any.The user presses the button, switches to a private chat with the bot and,
+ in doing so, passes a start parameter that instructs the bot to return an OAuth link. Once done,
+ the bot can offer a switch_inline button so that the user can easily return to the chat
+ where they wanted to use the bot's inline capabilities.
+
+
+
+
+ Initializes a new object
+
+
+ Label text on the button
+
+
+
+
+ Type of the InlineQueryResult
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ///
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ///
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Represents a venue. By default, the venue will be sent by the user. Alternatively, you can use
+ to send a message with the specified
+ content instead of the venue.
+
+
+
+
+ Type of the result, must be venue
+
+
+
+
+
+
+
+
+
+
+ Title of the venue
+
+
+
+
+ Address of the venue
+
+
+
+
+ Optional. Foursquare identifier of the venue if known
+
+
+
+
+ Optional. Foursquare type of the venue. (For example, "arts_entertainment/default",
+ "arts_entertainment/aquarium" or "food/icecream".)
+
+
+
+
+ Google Places identifier of the venue
+
+
+
+
+ Google Places type of the venue.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new inline query result
+
+ Unique identifier of this result
+ Latitude of the location in degrees
+ Longitude of the location in degrees
+ Title of the result
+ Address of the venue
+
+
+
+ Represents a link to a page containing an embedded video player or a video file. By default, this
+ video file will be sent by the user with an optional caption. Alternatively, you can use
+ to send a message with the specified
+ content instead of the video.
+
+
+ If an message contains an embedded video (e.g., YouTube),
+ you must replace its content using .
+
+
+
+
+ Type of the result, must be video
+
+
+
+
+ A valid URL for the embedded video player or video file
+
+
+
+
+ Mime type of the content of video url, “text/html” or “video/mp4”
+
+
+
+
+ URL of the thumbnail (jpeg only) for the video
+
+
+
+
+ Title for the result
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Optional. Video width
+
+
+
+
+ Optional. Video height
+
+
+
+
+ Optional. Video duration in seconds
+
+
+
+
+ Optional. Short description of the result
+
+
+
+
+ Optional. Content of the message to be sent instead of the video. This field is
+ required if is used to send an
+ HTML-page as a result (e.g., a YouTube video).
+
+
+
+
+ Initializes a new inline query result
+
+ Unique identifier of this result
+ A valid URL for the embedded video player
+ Url of the thumbnail for the result
+ Title of the result
+
+ Content of the message to be sent instead of the video. This field is required if
+ is used to send an HTML-page as a result
+ (e.g., a YouTube video).
+
+
+
+
+ Represents a link to a voice recording in an .OGG container encoded with OPUS. By default, this
+ voice recording will be sent by the user. Alternatively, you can use
+ to send a message with the specified
+ content instead of the voice message.
+
+
+
+
+ Type of the result, must be voice
+
+
+
+
+ A valid URL for the voice recording
+
+
+
+
+ Recording title
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Optional. Recording duration in seconds
+
+
+
+
+
+
+
+ Initializes a new inline query result
+
+ Unique identifier of this result
+ A valid URL for the voice recording
+ Title of the result
+
+
+
+ Represents the content of a contact message to be sent as the result of an inline query.
+
+
+
+
+ Contact's phone number
+
+
+
+
+ Contact's first name
+
+
+
+
+ Optional. Contact's last name
+
+
+
+
+ Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes
+
+
+
+
+ Initializes a new input contact message content
+
+ The phone number of the contact
+ The first name of the contact
+
+
+
+ Represents the content of an invoice message to be sent as the result of an
+ inline query.
+
+
+
+
+ Product name, 1-32 characters
+
+
+
+
+ Product description, 1-255 characters
+
+
+
+
+ Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user,
+ use for your internal processes.
+
+
+
+
+ Payment provider token, obtained via @Botfather
+
+
+
+
+ Three-letter ISO 4217 currency code, see
+ more on currencies
+
+
+
+
+ Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost,
+ delivery tax, bonus, etc.)
+
+
+
+
+ Optional. The maximum accepted amount for tips in the smallest units of the currency
+ (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass
+ max_tip_amount = 145. See the exp parameter in
+ currencies.json,
+ it shows the number of digits past the decimal point for each currency (2 for the
+ majority of currencies). Defaults to 0
+
+
+
+
+ Optional. An array of suggested amounts of tip in the smallest units of the currency
+ (integer, not float/double). At most 4 suggested tip amounts can be specified. The
+ suggested tip amounts must be positive, passed in a strictly increased order and
+ must not exceed .
+
+
+
+
+ Optional. A JSON-serialized object for data about the invoice, which will be shared with
+ the payment provider. A detailed description of the required fields should be provided by
+ the payment provider.
+
+
+
+
+ Optional. URL of the product photo for the invoice. Can be a photo of the goods or a
+ marketing image for a service. People like it better when they see what they are paying for.
+
+
+
+
+ Optional. Photo size
+
+
+
+
+ Optional. Photo width
+
+
+
+
+ Optional. Photo height
+
+
+
+
+ Optional. Pass , if you require the user's full name to complete the order
+
+
+
+
+ Optional. Pass , if you require the user's phone number to complete the order
+
+
+
+
+ Optional. Pass , if you require the user's email address to complete the order
+
+
+
+
+ Optional. Pass , if you require the user's shipping address to complete the order
+
+
+
+
+ Optional. Pass , if user's phone number should be sent to provider
+
+
+
+
+ Optional. Pass , if user's email address should be sent to provider
+
+
+
+
+ Optional. Pass , if the final price depends on the shipping method
+
+
+
+
+ Initializes with title, description, payload, providerToken, currency and an array of
+
+
+ Product name, 1-32 characters
+ Product description, 1-255 characters
+ Bot-defined invoice payload, 1-128 bytes
+ Payments provider token, obtained via BotFather
+ Three-letter ISO 4217 currency code
+
+ Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost,
+ delivery tax, bonus, etc.)
+
+
+
+
+ Represents the content of a location message to be sent as the result of an
+ inline query.
+
+
+
+
+ Latitude of the location in degrees
+
+
+
+
+ Longitude of the location in degrees
+
+
+
+
+ Optional. The radius of uncertainty for the location, measured in meters; 0-1500
+
+
+
+
+ Optional. Period in seconds for which the location can be updated, should be between 60 and 86400.
+
+
+
+
+ Optional. The direction in which user is moving, in degrees; 1-360. For active live locations only.
+
+
+
+
+ Optional. Maximum distance for proximity alerts about approaching another chat member,
+ in meters. For sent live locations only.
+
+
+
+
+ Initializes a new input location message content
+
+ The latitude of the location
+ The longitude of the location
+
+
+
+ This object represents the content of a message to be sent as a result of an
+ inline query.
+
+
+
+
+ Represents the content of a text message to be sent as the result of an
+ inline query.
+
+
+
+
+ Text of the message to be sent, 1-4096 characters
+
+
+
+
+ Optional. Mode for
+ parsing entities in the message
+ text. See formatting options for more details.
+
+
+
+
+ Optional. List of special entities that appear in message text, which can be specified
+ instead of
+
+
+
+
+ Optional. Disables link previews for links in the sent message
+
+
+
+
+ Initializes a new input text message content
+
+ The text of the message
+
+
+
+ Represents the content of a message to be sent as the result of an
+ inline query.
+
+
+
+
+ Latitude of the venue in degrees
+
+
+
+
+ Longitude of the venue in degrees
+
+
+
+
+ Name of the venue
+
+
+
+
+ Address of the venue
+
+
+
+
+ Optional. Foursquare identifier of the venue, if known
+
+
+
+
+ Optional. Foursquare type of the venue. (For example, “arts_entertainment/default”,
+ “arts_entertainment/aquarium” or “food/icecream”.)
+
+
+
+
+ Google Places identifier of the venue
+
+
+
+
+ Google Places type of the venue.
+
+
+
+
+
+ Initializes a new inline query result
+
+ The name of the venue
+ The address of the venue
+ The latitude of the venue
+ The longitude of the venue
+
+
+
+ A file to send
+
+
+
+
+ Type of file to send
+
+
+
+
+ Creates an instance of from a string containing a file's URL or file id
+
+ A file's URL or a file id
+ An instance of a class that implements
+
+
+
+ Creates an from an instance
+
+ A with file data to upload
+ An optional file name
+ An instance of
+
+
+
+ Creates an from an instance
+
+
+ An instance of
+
+
+
+ Creates an from a URL passed as a
+
+ A URL of a file
+ An instance of
+
+
+
+ Creates an from a file id
+
+ An ID of a file
+ An instance of
+
+
+
+ This object represents a file that is already stored somewhere on the Telegram servers
+
+
+
+
+
+
+
+ A file identifier
+
+
+
+
+ This object represents a file that is already stored somewhere on the Telegram servers
+
+ A file identifier
+
+
+
+ This object represents the contents of a file to be uploaded. Must be posted using multipart/form-data in
+ the usual way that files are uploaded via the browser
+
+
+
+
+
+
+
+ File content to upload
+
+
+
+
+ Name of a file to upload using multipart/form-data
+
+
+
+
+ This object represents the contents of a file to be uploaded. Must be posted using multipart/form-data
+ in the usual way that files are uploaded via the browser.
+
+ File content to upload
+ Name of a file to upload using multipart/form-data
+
+
+
+ This object represents an HTTP URL for the file to be sent
+
+
+
+
+
+
+
+ HTTP URL for the file to be sent
+
+
+
+
+ This object represents an HTTP URL for the file to be sent
+
+ HTTP URL for the file to be sent
+
+
+
+ This object represents an HTTP URL for the file to be sent
+
+ HTTP URL for the file to be sent
+
+
+
+ A marker for input media types that can be used in sendMediaGroup method.
+
+
+
+
+ Indicates that an has a thumbnail.
+
+
+
+
+ Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for
+ the file is supported server-side. The thumbnail should be in JPEG format and less
+ than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored
+ if the file is not uploaded using multipart/form-data. Thumbnails can't be reused
+ and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>"
+ if the thumbnail was uploaded using multipart/form-data under <file_attach_name>.
+
+
+
+
+ This object represents the content of a media message to be sent
+
+
+
+
+ Type of the media
+
+
+
+
+ File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended),
+ pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>"
+ to upload a new one using multipart/form-data under <file_attach_name%gt; name.
+
+
+
+
+ Optional. Caption of the photo to be sent, 0-1024 characters
+
+
+
+
+ Optional. List of special entities that appear in the caption, which can be specified instead
+ of
+
+
+
+
+ Change, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in a caption
+
+
+
+
+ Initialize an object
+
+ File to send
+
+
+
+ Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent.
+
+
+
+
+
+
+
+
+
+
+ Optional. Animation width
+
+
+
+
+ Optional. Animation height
+
+
+
+
+ Optional. Animation duration
+
+
+
+
+ Optional. Pass if the animation needs to be covered with a spoiler animation
+
+
+
+
+ Initializes a new animation media to send with an
+
+ File to send
+
+
+
+ Represents an audio file to be treated as music to be sent.
+
+
+
+
+
+
+
+
+
+
+ Optional. Duration of the audio in seconds
+
+
+
+
+ Optional. Performer of the audio
+
+
+
+
+ Optional. Title of the audio
+
+
+
+
+ Initializes a new audio media to send with an
+
+ File to send
+
+
+
+ Represents a general file to be sent
+
+
+
+
+
+
+
+
+
+
+ Optional. Disables automatic server-side content type detection for files uploaded using
+ multipart/form-data. Always true, if the document is sent as part of an album.
+
+
+
+
+ Initializes a new document media to send with an
+
+ File to send
+
+
+
+ Represents a photo to be sent
+
+
+
+
+
+
+
+ Optional. Pass if the photo needs to be covered with a spoiler animation
+
+
+
+
+ Initializes a new photo media to send with an
+
+ File to send
+
+
+
+ Represents a video to be sent
+
+
+
+
+
+
+
+
+
+
+ Optional. Video width
+
+
+
+
+ Optional. Video height
+
+
+
+
+ Optional. Video duration
+
+
+
+
+ Optional. Pass True, if the uploaded video is suitable for streaming
+
+
+
+
+ Optional. Pass if the video needs to be covered with a spoiler animation
+
+
+
+
+ Initializes a new video media to send with an
+
+ File to send
+
+
+
+ This object describes a sticker to be added to a sticker set.
+
+
+
+
+
+ The added sticker. Pass a as a String to send a file that already exists
+ on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file
+ from the Internet, or upload a new one using multipart/form-data.
+ Animated and video
+ stickers can't be uploaded via HTTP URL.
+ If you are using a , then the property is required.
+
+
+
+
+ List of 1-20 emoji associated with the sticker
+
+
+
+
+ Optional. Position where the mask should be placed on faces.
+ For stickers only.
+
+
+
+
+ Optional. List of 0-20 search keywords for the sticker with total length of up to 64 characters.
+ For and stickers only.
+
+
+
+
+ Initializes a new input sticker to create or add sticker sets
+ with an sticker and emojiList
+
+
+ The added sticker. Pass a file_id as a String to send a file that already exists
+ on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file
+ from the Internet, or upload a new one using multipart/form-data.
+ Animated and video
+ stickers can't be uploaded via HTTP URL.
+
+
+ List of 1-20 emoji associated with the sticker
+
+
+
+
+ This object represents a point on the map.
+
+
+
+
+ Longitude as defined by sender
+
+
+
+
+ Latitude as defined by sender
+
+
+
+
+ Optional. The radius of uncertainty for the location, measured in meters; 0-1500
+
+
+
+
+ Optional. Time relative to the message sending date, during which the location can be updated, in seconds. For active live locations only.
+
+
+
+
+ Optional. The direction in which user is moving, in degrees; 1-360. For active live locations only.
+
+
+
+
+ Optional. Maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only.
+
+
+
+
+ This object represents a parameter of the inline keyboard button used to automatically authorize a user.
+ Serves as a great replacement for the
+ Telegram Login Widget when the user is coming from
+ Telegram. All the user needs to do is tap/click a button and confirm that they want to log in.
+
+ Telegram apps support these buttons as of
+ version 5.7.
+
+
+
+
+
+ An HTTP URL to be opened with user authorization data added to the query string when the button is pressed.
+ If the user refuses to provide authorization data, the original URL without information about the user will
+ be opened. The data added is the same as described in
+
+ Receiving authorization data
+ .
+
+ NOTE: You must always check the hash of the received data to verify the authentication and
+ the integrity of the data as described in
+ Checking authorization.
+
+
+
+
+
+ Optional. New text of the button in forwarded messages
+
+
+
+
+ Optional. Username of a bot, which will be used for user authorization. See
+ Setting up a bot for more
+ details. If not specified, the current bot’s username will be assumed. The url's domain must be the same
+ as the domain linked with the bot. See
+
+ Linking your domain to the bot for more details.
+
+
+
+
+ Optional. Pass to request the permission for your bot to send messages to the user
+
+
+
+
+ This object describes the position on faces where a mask should be placed by default.
+
+
+
+
+ The part of the face relative to which the mask should be placed.
+
+
+
+
+ Shift by X-axis measured in widths of the mask scaled to the face size, from left to right.
+ For example, choosing -1.0 will place mask just to the left of the default mask position.
+
+
+
+
+ Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom.
+ For example, 1.0 will place the mask just below the default mask position.
+
+
+
+
+ Mask scaling coefficient. For example, 2.0 means double size.
+
+
+
+
+ This object describes the bot’s menu button in a private chat. It should be one of:
+
+ MenuButtonCommands
+ MenuButtonWebApp
+ MenuButtonDefault
+
+ If a menu button other than MenuButtonDefault is set for a private chat, then it is applied in the chat.
+ Otherwise the default menu button is applied. By default, the menu button opens the list of bot commands.
+
+
+
+
+ Type of the button
+
+
+
+
+ Represents a menu button, which opens the bot’s list of commands.
+
+
+
+
+
+
+
+ Represents a menu button, which launches a Web App.
+
+
+
+
+
+
+
+ Text on the button
+
+
+
+
+ Description of the Web App that will be launched when the user presses the button. The Web App will be able
+ to send an arbitrary message on behalf of the user using the method .
+
+
+
+
+ Describes that no specific value for the menu button was set.
+
+
+
+
+
+
+
+ This object represents a message.
+
+
+
+
+ Unique message identifier inside this chat
+
+
+
+
+ Optional. Unique identifier of a message thread to which the message belongs; for supergroups only
+
+
+
+
+ Optional. Sender, empty for messages sent to channels
+
+
+
+
+ Optional. Sender of the message, sent on behalf of a chat. The channel itself for channel messages.
+ The supergroup itself for messages from anonymous group administrators. The linked channel for messages
+ automatically forwarded to the discussion group
+
+
+
+
+ Date the message was sent
+
+
+
+
+ Conversation the message belongs to
+
+
+
+
+ Optional. For forwarded messages, sender of the original message
+
+
+
+
+ Optional. , if the message is sent to a forum topic
+
+
+
+
+ Optional. For messages forwarded from channels or from anonymous administrators, information about the
+ original sender chat
+
+
+
+
+ Optional. For messages forwarded from channels, identifier of the original message in the channel
+
+
+
+
+ Optional. For messages forwarded from channels, signature of the post author if present
+
+
+
+
+ Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in
+ forwarded messages
+
+
+
+
+ Optional. For forwarded messages, date the original message was sent
+
+
+
+
+ Optional. , if the message is a channel post that was automatically forwarded to the connected
+ discussion group
+
+
+
+
+ Optional. For replies, the original message. Note that the object in this field
+ will not contain further fields even if it itself is a reply.
+
+
+
+
+ Optional. Bot through which the message was sent
+
+
+
+
+ Optional. Date the message was last edited
+
+
+
+
+ Optional. , if messages from the chat can't be forwarded to other chats.
+ Returned only in .
+
+
+
+
+ Optional. The unique identifier of a media message group this message belongs to
+
+
+
+
+ Optional. Signature of the post author for messages in channels, or the custom title of an anonymous
+ group administrator
+
+
+
+
+ Optional. For text messages, the actual text of the message, 0-4096 characters
+
+
+
+
+ Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear
+ in the text
+
+
+
+
+ Gets the entity values.
+
+
+ The entity contents.
+
+
+
+
+ Optional. Message is an animation, information about the animation. For backward compatibility, when this
+ field is set, the field will also be set
+
+
+
+
+ Optional. Message is an audio file, information about the file
+
+
+
+
+ Optional. Message is a general file, information about the file
+
+
+
+
+ Optional. Message is a photo, available sizes of the photo
+
+
+
+
+ Optional. Message is a sticker, information about the sticker
+
+
+
+
+ Optional. Message is a video, information about the video
+
+
+
+
+ Optional. Message is a video note, information about the video message
+
+
+
+
+ Optional. Message is a voice message, information about the file
+
+
+
+
+ Optional. Caption for the animation, audio, document, photo, video or voice, 0-1024 characters
+
+
+
+
+ Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that
+ appear in the caption
+
+
+
+
+ Gets the caption entity values.
+
+
+ The caption entity contents.
+
+
+
+
+ Optional. , if the message media is covered by a spoiler animation
+
+
+
+
+ Optional. Message is a shared contact, information about the contact
+
+
+
+
+ Optional. Message is a dice with random value
+
+
+
+
+ Optional. Message is a game, information about the game
+
+
+
+
+ Optional. Message is a native poll, information about the poll
+
+
+
+
+ Optional. Message is a venue, information about the venue. For backward compatibility, when this field
+ is set, the field will also be set
+
+
+
+
+ Optional. Message is a shared location, information about the location
+
+
+
+
+ Optional. New members that were added to the group or supergroup and information about them
+ (the bot itself may be one of these members)
+
+
+
+
+ Optional. A member was removed from the group, information about them (this member may be the bot itself)
+
+
+
+
+ Optional. A chat title was changed to this value
+
+
+
+
+ Optional. A chat photo was change to this value
+
+
+
+
+ Optional. Service message: the chat photo was deleted
+
+
+
+
+ Optional. Service message: the group has been created
+
+
+
+
+ Optional. Service message: the supergroup has been created. This field can't be received in a message
+ coming through updates, because bot can't be a member of a supergroup when it is created. It can only be
+ found in if someone replies to a very first message in a directly created
+ supergroup.
+
+
+
+
+ Optional. Service message: the channel has been created. This field can't be received in a message coming
+ through updates, because bot can't be a member of a channel when it is created. It can only be found in
+ if someone replies to a very first message in a channel.
+
+
+
+
+ Optional. Service message: auto-delete timer settings changed in the chat
+
+
+
+
+ Optional. The group has been migrated to a supergroup with the specified identifier
+
+
+
+
+ Optional. The supergroup has been migrated from a group with the specified identifier
+
+
+
+
+ Optional. Specified message was pinned. Note that the Message object in this field will not contain
+ further fields even if it is itself a reply.
+
+
+
+
+ Optional. Message is an invoice for a
+ payment, information about the invoice
+
+
+
+
+ Optional. Message is a service message about a successful payment, information about the payment
+
+
+
+
+ Optional. Service message: a user was shared with the bot
+
+
+
+
+ Optional. Service message: a chat was shared with the bot
+
+
+
+
+ Optional. The domain name of the website on which the user has logged in
+
+
+
+
+ Optional. Service message: the user allowed the bot added to the attachment menu to write messages
+
+
+
+
+ Optional. Telegram Passport data
+
+
+
+
+ Optional. Service message. A user in the chat triggered another user's proximity alert while
+ sharing Live Location
+
+
+
+
+ Optional. Service message: forum topic created
+
+
+
+
+ Optional. Service message: forum topic edited
+
+
+
+
+ Optional. Service message: forum topic closed
+
+
+
+
+ Optional. Service message: forum topic reopened
+
+
+
+
+ Optional. Service message: the 'General' forum topic hidden
+
+
+
+
+ Optional. Service message: the 'General' forum topic unhidden
+
+
+
+
+ Optional. Service message: video chat scheduled
+
+
+
+
+ Optional. Service message: video chat started
+
+
+
+
+ Optional. Service message: video chat ended
+
+
+
+
+ Optional. Service message: new participants invited to a video chat
+
+
+
+
+ Optional. Service message: data sent by a Web App
+
+
+
+
+ Optional. Inline keyboard attached to the message. buttons are represented as
+ ordinary url buttons.
+
+
+
+
+ Gets the of the
+
+
+ The of the
+
+
+
+
+ This object represents a service message about a change in auto-delete timer settings.
+
+
+
+
+ New auto-delete time for messages in the chat
+
+
+
+
+ This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
+
+
+
+
+ Type of the entity
+
+
+
+
+ Offset in UTF-16 code units to the start of the entity
+
+
+
+
+ Length of the entity in UTF-16 code units
+
+
+
+
+ Optional. For only, URL that will be opened after user taps on the text
+
+
+
+
+ Optional. For only, the mentioned user
+
+
+
+
+ Optional. For only, the programming language of the entity text
+
+
+
+
+ Optional. For only, unique identifier of the custom emoji.
+ Use to get full information about the sticker
+
+
+
+
+ This object represents a messageId.
+
+
+
+
+ Message identifier in the chat specified in
+
+
+
+
+ Contains data required for decrypting and authenticating .
+ See the Telegram Passport
+ Documentation for a complete description of the data decryption and authentication processes.
+
+
+
+
+ Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets
+ required for decryption and authentication.
+
+
+
+
+ Base64-encoded data hash for data authentication.
+
+
+
+
+ Base64-encoded secret, encrypted with the bot’s public RSA key, required for data decryption.
+
+
+
+
+ Contains information about documents or other Telegram Passport elements shared with the bot by the user.
+
+
+
+
+ Element type. One of
+
+
+
+
+ Optional. Base64-encoded encrypted Telegram Passport element data provided by the user, available for
+ , , ,
+ , and
+ types. Can be decrypted and verified using the accompanying .
+
+
+
+
+ Optional. User's verified phone number, available only for type.
+
+
+
+
+ Optional. User's verified email address, available only for type.
+
+
+
+
+ Optional. Array of encrypted files with documents provided by the user, available for
+ , , ,
+ and types.
+ Files can be decrypted and verified using the accompanying .
+
+
+
+
+ Optional. Encrypted file with the front side of the document, provided by the user. Available for
+ , , and
+ . The file can be decrypted and verified using the accompanying
+ .
+
+
+
+
+ Optional. Encrypted file with the reverse side of the document, provided by the user. Available for
+ and . The file can be decrypted and verified using
+ the accompanying .
+
+
+
+
+ Optional. Encrypted file with the selfie of the user holding a document, provided by the user;
+ available for , , and
+ . The file can be decrypted and verified using the accompanying
+ .
+
+
+
+
+ Optional. Array of encrypted files with translated versions of documents provided by the user.
+ Available if requested for , ,
+ , , ,
+ , , and
+ types. Files can be decrypted and verified using the accompanying
+ .
+
+
+
+
+ Base64-encoded element hash for using in PassportElementErrorUnspecified
+
+
+
+
+ element type
+
+
+
+
+ Personal details
+
+
+
+
+ Passport
+
+
+
+
+ Driver licence
+
+
+
+
+ Identity card
+
+
+
+
+ Internal passport
+
+
+
+
+ Address
+
+
+
+
+ Utility bill
+
+
+
+
+ Bank statement
+
+
+
+
+ Rental agreement
+
+
+
+
+ Passport registration
+
+
+
+
+ Temporary registration
+
+
+
+
+ Phone number
+
+
+
+
+ Email
+
+
+
+
+ Contains information about Telegram Passport data shared with the bot by the user.
+
+
+
+
+ Array with information about documents and other Telegram Passport elements that was shared with the bot.
+
+
+
+
+ Encrypted credentials required to decrypt the data.
+
+
+
+
+ This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB.
+
+
+
+
+ DateTime when the file was uploaded
+
+
+
+
+ This object contains basic information about an invoice.
+
+
+
+
+
+ Product name
+
+
+
+
+ Product description
+
+
+
+
+ Unique bot deep-linking parameter that can be used to generate this invoice
+
+
+
+
+ Three-letter ISO 4217
+ currency code
+
+
+
+
+ Total price in the smallest units of the
+ currency
+ (integer, not float/double).
+
+ For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in
+ currencies.json, it shows the
+ number of digits past the decimal point for each currency (2 for the majority of currencies).
+
+
+
+
+
+ This object represents a portion of the price for goods or services.
+
+
+
+
+
+ Portion label
+
+
+
+
+ Price of the product in the smallest units of the
+ currency
+ (integer, not float/double).
+
+ For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in
+ currencies.json, it shows the number
+ of digits past the decimal point for each currency (2 for the majority of currencies).
+
+
+
+
+
+ Initializes an instance of
+
+ Portion label
+ Price of the product
+
+
+
+ This object represents information about an order.
+
+
+
+
+ Optional. User name
+
+
+
+
+ Optional. User's phone number
+
+
+
+
+ Optional. User email
+
+
+
+
+ Optional. User shipping address
+
+
+
+
+ This object contains information about an incoming pre-checkout query.
+
+
+
+
+ Unique query identifier
+
+
+
+
+ User who sent the query
+
+
+
+
+ Three-letter ISO 4217
+ currency code
+
+
+
+
+ Total price in the smallest units of the
+ currency
+ (integer, not float/double).
+
+ For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in
+ currencies.json, it shows the
+ number of digits past the decimal point for each currency (2 for the majority of currencies).
+
+
+
+
+
+ Bot specified invoice payload
+
+
+
+
+ Optional. Identifier of the shipping option chosen by the user
+
+
+
+
+ Optional. Order info provided by the user
+
+
+
+
+ This object represents a shipping address.
+
+
+
+
+ ISO 3166-1 alpha-2 country code
+
+
+
+
+ State, if applicable
+
+
+
+
+ City
+
+
+
+
+ First line for the address
+
+
+
+
+ Second line for the address
+
+
+
+
+ Address post code
+
+
+
+
+ This object represents one shipping option.
+
+
+
+
+ Shipping option identifier
+
+
+
+
+ Option title
+
+
+
+
+ List of price portions
+
+
+
+
+ This object contains information about an incoming shipping query.
+
+
+
+
+ Unique query identifier
+
+
+
+
+ User who sent the query
+
+
+
+
+ Bot specified invoice payload
+
+
+
+
+ User specified shipping address
+
+
+
+
+ This object contains basic information about a successful payment.
+
+
+
+
+ Three-letter ISO 4217
+ currency code
+
+
+
+
+ Total price in the smallest units of the
+ currency
+ (integer, not float/double).
+
+ For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter
+ in currencies.json, it shows
+ the number of digits past the decimal point for each currency (2 for the majority of currencies).
+
+
+
+
+
+ Bot specified invoice payload
+
+
+
+
+ Optional. Identifier of the shipping option chosen by the user
+
+
+
+
+ Optional. Order info provided by the user
+
+
+
+
+ Telegram payment identifier
+
+
+
+
+ Provider payment identifier
+
+
+
+
+ This object represents one size of a photo or a file / sticker thumbnail.
+
+ A missing thumbnail for a file (or sticker) is presented as an empty object.
+
+
+
+ Photo width
+
+
+
+
+ Photo height
+
+
+
+
+ This object contains information about a poll.
+
+
+
+
+ Unique poll identifier
+
+
+
+
+ Poll question, 1-300 characters
+
+
+
+
+ List of poll options
+
+
+
+
+ Total number of users that voted in the poll
+
+
+
+
+ , if the poll is closed
+
+
+
+
+ , if the poll is anonymous
+
+
+
+
+ Poll type, currently can be “regular” or “quiz”
+
+
+
+
+ , if the poll allows multiple answers
+
+
+
+
+ Optional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode,
+ which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.
+
+
+
+
+ Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a
+ quiz-style poll, 0-200 characters
+
+
+
+
+ Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the
+
+
+
+
+
+ Optional. Amount of time in seconds the poll will be active after creation
+
+
+
+
+ Optional. Point in time when the poll will be automatically closed
+
+
+
+
+ This object represents an answer of a user in a non-anonymous poll.
+
+
+
+
+ Unique poll identifier
+
+
+
+
+ The user, who changed the answer to the poll
+
+
+
+
+ 0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote.
+
+
+
+
+ This object contains information about one answer option in a poll.
+
+
+
+
+ Option text, 1-100 characters
+
+
+
+
+ Number of users that voted for this option
+
+
+
+
+ Represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set
+ by another user.
+
+
+
+
+ User that triggered the alert
+
+
+
+
+ User that set the alert
+
+
+
+
+ The distance between the users
+
+
+
+
+ Upon receiving a with this object, Telegram clients will display a reply interface to the
+ user (act as if the user has selected the bot’s message and tapped 'Reply'). This can be extremely useful if you
+ want to create user-friendly step-by-step interfaces without having to sacrifice
+ privacy mode.
+
+
+
+
+ Shows reply interface to the user, as if they manually selected the bot’s message and tapped 'Reply'
+
+
+
+
+ Optional. The placeholder to be shown in the input field when the reply is active; 1-64 characters
+
+
+
+
+ Marker interface for a regular or inline button of the reply keyboard
+
+
+
+
+ Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed
+
+
+
+
+ This object represents one button of an inline keyboard. You must use exactly one of the optional fields.
+
+
+
+
+
+
+
+ Optional. HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id=<user_id>
+ can be used to mention a user by their ID without using a username, if this is allowed by their privacy settings.
+
+
+
+
+ Optional. Data to be sent in a callback query to the bot when button
+ is pressed, 1-64 bytes
+
+
+
+
+ Optional. Description of the Web App that will be launched when the user presses the button. The Web App will
+ be able to send an arbitrary message on behalf of the user using the request
+ . Available only in private chats between a user and the bot.
+
+
+
+
+ Optional. An HTTP URL used to automatically authorize the user. Can be used as a replacement for the
+ Telegram Login Widget.
+
+
+
+
+ Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and
+ insert the bot’s username and the specified inline query in the input field. Can be empty, in which case just
+ the bot’s username will be inserted.
+
+
+ Note: This offers an easy way for users to start using your bot in
+ inline mode when they are currently in a private chat
+ with it. Especially useful when combined with SwitchPm…
+ actions – in this case the user will be automatically returned to the chat they switched from, skipping the
+ chat selection screen.
+
+
+
+
+ Optional. If set, pressing the button will insert the bot’s username and the specified inline query in the
+ current chat’s input field. Can be empty, in which case only the bot’s username will be inserted.
+
+
+ This offers a quick way for the user to open your bot in inline mode in the same chat – good for selecting
+ something from multiple options.
+
+
+
+
+ Optional. If set, pressing the button will prompt the user to select one of their chats of the specified type,
+ open that chat and insert the bot's username and the specified inline query in the input field
+
+
+
+
+ Optional. Description of the game that will be launched when the user presses the button.
+
+
+ NOTE: This type of button must always be the first button in the first row.
+
+
+
+
+ Optional. Specify , to send a Pay button.
+
+
+ NOTE: This type of button must always be the first button in the first row.
+
+
+
+
+ Instantiates new Inline Keyboard object
+
+ Label text on the button
+
+
+
+ Creates an inline keyboard button that opens a HTTP url when pressed
+
+ Label text on the button
+ HTTP or tg:// url to be opened when button is pressed
+
+
+
+ Creates an inline keyboard button that opens a HTTP url to automatically authorize the user
+
+ Label text on the button
+
+ An HTTP URL used to automatically authorize the user. Can be used as a replacement for the
+ Telegram Login Widget.
+
+
+
+
+
+ Creates an inline keyboard button that sends to bot when pressed
+
+
+ Text and data of the button to be sent in a callback query to the bot when
+ button is pressed, 1-64 bytes
+
+
+
+
+ Creates an inline keyboard button that sends to bot when pressed
+
+ Label text on the button
+
+ Data to be sent in a callback query to the bot when button is pressed,
+ 1-64 bytes
+
+
+
+
+ Creates an inline keyboard button. Pressing the button will prompt the user to select one of their chats,
+ open that chat and insert the bot’s username and the specified inline query in the input field.
+
+ Label text on the button
+
+ If set, pressing the button will prompt the user to select one of their chats, open that chat and insert
+ the bot’s username and the specified inline query in the input field. Can be empty, in which case just the
+ bot’s username will be inserted.
+
+
+
+
+
+ Creates an inline keyboard button. Pressing the button will insert the bot’s username and the specified inline
+ query in the current chat’s input field.
+
+ Label text on the button
+
+ If set, pressing the button will insert the bot’s username and the specified inline query in the current
+ chat’s input field. Can be empty, in which case only the bot’s username will be inserted.
+
+
+
+
+ Creates an inline keyboard button. Pressing the button will prompt the user to select one of their chats
+ of the specified type, open that chat and insert the bot's username and the specified inline query
+ in the input field
+
+ Label text on the button
+
+ represents an inline button that switches the current user to inline mode in a chosen chat,
+ with an optional default inline query.
+
+
+
+
+
+ Creates an inline keyboard button. Pressing the button will launch the game.
+
+ Label text on the button
+
+ Description of the game that will be launched when the user presses the button.
+
+
+
+
+ Creates an inline keyboard button for a PayButton
+
+ Label text on the button
+
+
+
+ Generate an inline keyboard button to request a web app
+
+ Button's text
+ Web app information
+
+
+
+
+ Performs an implicit conversion from to
+ with callback data
+
+ Label text and callback data of the button
+
+ The result of the conversion.
+
+
+
+
+ This object represents an inline keyboard that appears right next to the it belongs to.
+
+
+ Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will display
+ unsupported message.
+
+
+
+
+ Array of rows, each represented by an Array of
+ .
+
+
+
+
+ Initializes a new instance of the class with only one keyboard button
+
+ Keyboard button
+
+
+
+ Initializes a new instance of the class with a one-row keyboard
+
+ The inline keyboard row
+
+
+
+ Initializes a new instance of the class.
+
+ The inline keyboard.
+
+
+
+ Generate an empty inline keyboard markup
+
+ Empty inline keyboard markup
+
+
+
+ Generate an inline keyboard markup with one button
+
+ Inline keyboard button
+
+
+
+ Generate an inline keyboard markup with one button
+
+ Text of the button
+
+
+
+ Generate an inline keyboard markup from multiple buttons
+
+ Keyboard buttons
+
+
+
+ Generate an inline keyboard markup from multiple buttons on 1 row
+
+ Keyboard buttons
+
+
+
+ A marker interface for reply markups that define how a can reply to the sent
+
+
+
+
+ This object represents one button of the reply keyboard. For simple text buttons can be
+ used instead of this object to specify text of the button.
+
+
+
+ Note: and options will only work in Telegram
+ versions released after 9 April, 2016. Older clients will display unsupported message.
+
+
+ Note: option will only work in Telegram versions released after 23 January, 2020.
+ Older clients will display unsupported message.
+
+
+ Note: option will only work in Telegram versions released after 16 April, 2022. Older
+ clients will display unsupported message.
+
+
+
+
+
+
+
+
+ Optional. If specified, pressing the button will open a list of suitable users. Tapping on any user will send
+ their identifier to the bot in a “user_shared” service message. Available in private chats only.
+
+
+
+
+ Optional. If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send
+ its identifier to the bot in a “chat_shared” service message. Available in private chats only.
+
+
+
+
+ Optional. If , the user's phone number will be sent as a contact when the button
+ is pressed. Available in private chats only
+
+
+
+
+ Optional. If , the user's current location will be sent when the button is pressed.
+ Available in private chats only
+
+
+
+
+ Optional. If specified, the user will be asked to create a poll and send it to the bot when the button
+ is pressed. Available in private chats only
+
+
+
+
+ Optional. If specified, the described Web App will be launched when the button is pressed. The Web App will
+ be able to send a “web_app_data” service message. Available in private chats only.
+
+
+
+
+ Initializes a new instance of the class.
+
+ Label text on the button
+
+
+
+ Generate a keyboard button to request for contact
+
+ Button's text
+ Keyboard button
+
+
+
+ Generate a keyboard button to request for location
+
+ Button's text
+ Keyboard button
+
+
+
+ Generate a keyboard button to request a poll
+
+ Button's text
+ Poll's type
+ Keyboard button
+
+
+
+ Generate a keyboard button to request a web app
+
+ Button's text
+ Web app information
+
+
+
+
+ Generate a keyboard button to request user info
+
+ Button's text
+ Criteria used to request a suitable user
+
+
+
+
+ Generate a keyboard button to request chat info
+
+ Button's text
+ Criteria used to request a suitable chat
+
+
+
+
+ Generate a keyboard button from text
+
+ Button's text
+ Keyboard button
+
+
+
+ This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.
+
+
+
+
+ Optional. If quiz is passed, the user will be allowed to create only polls in the quiz mode. If regular is passed, only regular polls will be allowed. Otherwise, the user will be allowed to create a poll of any type.
+
+
+
+
+ This object defines the criteria used to request a suitable chat. The identifier of the selected chat will be
+ shared with the bot when the corresponding button is pressed.
+
+
+
+
+ Signed 32-bit identifier of the request
+
+
+
+
+ Pass to request a channel chat, pass to request a group
+ or a supergroup chat.
+
+
+
+
+ Optional. Pass to request a forum supergroup, pass to
+ request a non-forum chat. If not specified, no additional restrictions are applied.
+
+
+
+
+ Optional. Pass to request a supergroup or a channel with a username,
+ pass to request a chat without a username. If not specified, no additional
+ restrictions are applied.
+
+
+
+
+ Optional. Pass to request a chat owned by the user. Otherwise, no additional
+ restrictions are applied.
+
+
+
+
+ Optional. A JSON-serialized object listing the required administrator rights of the user in the chat.
+ If not specified, no additional restrictions are applied.
+
+
+
+
+ Optional. A JSON-serialized object listing the required administrator rights of the bot in the chat.
+ The rights must be a subset of . If not specified, no additional
+ restrictions are applied.
+
+
+
+
+ Optional. Pass to request a chat with the bot as a member. Otherwise, no additional
+ restrictions are applied.
+
+
+
+
+ This object defines the criteria used to request a suitable user. The identifier of the selected user will be
+ shared with the bot when the corresponding button is pressed.
+
+
+
+
+ Signed 32-bit identifier of the request
+
+
+
+
+ Optional. Pass to request a bot, pass to request a regular user. If not specified, no additional
+ restrictions are applied.
+
+
+
+
+ Optional. Pass to request a premium user, pass to request a non-premium user. If not specified,
+ no additional restrictions are applied.
+
+
+
+
+ Represents a custom keyboard with reply options
+
+
+
+
+ Array of button rows, each represented by an Array of KeyboardButton objects
+
+
+
+
+ Optional. Requests clients to always show the keyboard when the regular keyboard is hidden. Defaults to
+ , in which case the custom keyboard can be hidden and opened with a keyboard icon.
+
+
+
+
+ Optional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard.
+
+
+
+
+ Optional. Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat – the user can press a special button in the input field to see the custom keyboard again. Defaults to false.
+
+
+
+
+ Optional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters
+
+
+
+
+ Initializes a new instance of with one button
+
+ Button on keyboard
+
+
+
+ Initializes a new instance of
+
+ The keyboard row.
+
+
+
+ Initializes a new instance of the class.
+
+ The keyboard.
+
+
+
+ Generates a reply keyboard markup with one button
+
+ Button's text
+
+
+
+ Generates a reply keyboard markup with multiple buttons on one row
+
+ Texts of buttons
+
+
+
+ Generates a reply keyboard markup with multiple buttons
+
+ Texts of buttons
+
+
+
+ Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ).
+
+
+
+
+ Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use '' in )
+
+
+
+
+ Defines how clients display a reply interface to the
+
+
+
+
+
+ Optional. Use this parameter if you want to show the keyboard to specific users only. Targets:
+
+
+ users that are @mentioned in the of the object;
+
+
+ if the bot’s message is a reply (has ), sender of the original
+ message.
+
+
+
+
+ Example: A user requests to change the bot’s language, bot replies to the request with a keyboard
+ to select the new language. Other users in the group don't see the keyboard.
+
+
+
+
+ Contains information about why a request was unsuccessful.
+
+
+
+
+ The group has been migrated to a supergroup with the specified identifier.
+
+
+
+
+ In case of exceeding flood control, the number of seconds left to wait before the request can be repeated.
+
+
+
+
+ Contains information about an inline message sent by a
+ Web App on behalf of a user.
+
+
+
+
+ Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached
+ to the message.
+
+
+
+
+ This object represents a sticker.
+
+
+
+
+
+ Type of the sticker. The type of the sticker is independent from its format,
+ which is determined by the fields and .
+
+
+
+
+ Sticker width
+
+
+
+
+ Sticker height
+
+
+
+
+ , if the sticker is animated
+
+
+
+
+ , if the sticker is a video sticker
+
+
+
+
+ Optional. Sticker thumbnail in the .WEBP or .JPG format
+
+
+
+
+ Optional. Emoji associated with the sticker
+
+
+
+
+ Optional. Name of the sticker set to which the sticker belongs
+
+
+
+
+ Optional. For premium regular stickers,
+ premium animation for the sticker
+
+
+
+
+ Optional. For mask stickers,
+ the position where the mask should be placed
+
+
+
+
+ Optional. For custom emoji stickers,
+ unique identifier of the custom emoji
+
+
+
+
+ Optional. , if the sticker must be repainted to a text color
+ in messages, the color of the Telegram Premium badge in emoji
+ status, white color on chat photos, or another appropriate
+ color in other places
+
+
+
+
+ This object represents a sticker set.
+
+
+
+
+
+ Sticker set name
+
+
+
+
+ Sticker set title
+
+
+
+
+ Type of stickers in the set
+
+
+
+
+ , if the sticker set contains animated stickers
+
+
+
+
+ , if the sticker set contains video stickers
+
+
+
+
+ List of all set stickers
+
+
+
+
+ Optional. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format
+
+
+
+
+ This object represents an inline button that switches the current user to inline mode in a chosen chat,
+ with an optional default inline query.
+
+
+
+
+ Optional. The default inline query to be inserted in the input field. If left empty,
+ only the bot's username will be inserted
+
+
+
+
+ Optional. , if private chats with users can be chosen
+
+
+
+
+ Optional. , if private chats with bots can be chosen
+
+
+
+
+ Optional. , if group and supergroup chats can be chosen
+
+
+
+
+ Optional. , if channel chats can be chosen
+
+
+
+
+ This object represents an incoming update.
+
+
+ Only one of the optional parameters can be present in any given update.
+
+
+
+
+ The update's unique identifier. Update identifiers start from a certain positive number and increase
+ sequentially. This ID becomes especially handy if you're using
+ Webhooks, since it allows you to ignore repeated
+ updates or to restore the correct update sequence, should they get out of order. If there are no new updates
+ for at least a week, then identifier of the next update will be chosen randomly instead of sequentially.
+
+
+
+
+ Optional. New incoming message of any kind — text, photo, sticker, etc.
+
+
+
+
+ Optional. New version of a message that is known to the bot and was edited
+
+
+
+
+ Optional. New incoming channel post of any kind — text, photo, sticker, etc.
+
+
+
+
+ Optional. New version of a channel post that is known to the bot and was edited
+
+
+
+
+ Optional. New incoming inline query
+
+
+
+
+ Optional. The result of a inline query that was chosen by a user and sent to their chat partner
+
+
+
+
+ Optional. New incoming callback query
+
+
+
+
+ Optional. New incoming shipping query. Only for invoices with flexible price
+
+
+
+
+ Optional. New incoming pre-checkout query. Contains full information about checkout
+
+
+
+
+ Optional. New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot
+
+
+
+
+ Optional. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were
+ sent by the bot itself.
+
+
+
+
+ Optional. The bot’s chat member status was updated in a chat. For private chats, this update is received
+ only when the bot is blocked or unblocked by the user.
+
+
+
+
+ Optional. A chat member's status was updated in a chat. The bot must be an administrator in the chat
+ and must explicitly specify “” in the list of allowed_updates to
+ receive these updates.
+
+
+
+
+ Optional. A request to join the chat has been sent. The bot must have the
+ administrator right in the chat to receive these updates.
+
+
+
+
+ Gets the update type.
+
+
+ The update type.
+
+
+
+
+ This object represents a Telegram user or bot.
+
+
+
+
+ Unique identifier for this user or bot
+
+
+
+
+ , if this user is a bot
+
+
+
+
+ User's or bot’s first name
+
+
+
+
+ Optional. User's or bot’s last name
+
+
+
+
+ Optional. User's or bot’s username
+
+
+
+
+ Optional. IETF language tag of the
+ user's language
+
+
+
+
+ Optional. , if this user is a Telegram Premium user
+
+
+
+
+ Optional. , if this user added the bot to the attachment menu
+
+
+
+
+ Optional. , if the bot can be invited to groups. Returned only in
+
+
+
+
+ Optional. , if privacy mode is disabled for the bot. Returned only in
+
+
+
+
+ Optional. , if the bot supports inline queries. Returned only in
+
+
+
+
+
+
+
+ This object represent a user's profile pictures.
+
+
+
+
+ Total number of profile pictures the target user has
+
+
+
+
+ Requested profile pictures (in up to 4 sizes each)
+
+
+
+
+ This object contains information about the user whose identifier was shared with the bot using a
+ button.
+
+
+
+
+ Identifier of the request
+
+
+
+
+ Identifier of the shared user. This number may have more than 32 significant bits and some programming
+ languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits,
+ so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have
+ access to the user and could be unable to use this identifier, unless the user is already known to the bot by
+ some other means.
+
+
+
+
+ This object represents a venue.
+
+
+
+
+ Venue location
+
+
+
+
+ Name of the venue
+
+
+
+
+ Address of the venue
+
+
+
+
+ Optional. Foursquare identifier of the venue
+
+
+
+
+ Optional. Foursquare type of the venue. (For example, "arts_entertainment/default",
+ "arts_entertainment/aquarium" or "food/icecream".)
+
+
+
+
+ Optional. Google Places identifier of the venue
+
+
+
+
+ Optional. Google Places type of the venue. (See
+ supported types.)
+
+
+
+
+ This object represents a video file.
+
+
+
+
+ Video width as defined by sender
+
+
+
+
+ Video height as defined by sender
+
+
+
+
+ Duration of the video in seconds as defined by sender
+
+
+
+
+ Optional. Video thumbnail
+
+
+
+
+ Optional. Original filename as defined by sender
+
+
+
+
+ Optional. Mime type of a file as defined by sender
+
+
+
+
+ This object represents a service message about a video chat ended in the chat.
+
+
+
+
+ Video chat duration in seconds
+
+
+
+
+ This object represents a service message about new members invited to a video chat.
+
+
+
+
+ Optional. New members that were invited to the voice chat
+
+
+
+
+ This object represents a service message about a video chat scheduled in the chat.
+
+
+
+
+ Point in time when the voice chat is supposed to be started by a chat administrator
+
+
+
+
+ This object represents a service message about a video chat started in the chat. Currently holds no information.
+
+
+
+
+ This object represents a video message
+ (available in Telegram apps as of
+ v.4.0).
+
+
+
+
+ Video width and height (diameter of the video message) as defined by sender
+
+
+
+
+ Duration of the video in seconds as defined by sender
+
+
+
+
+ Optional. Video thumbnail
+
+
+
+
+ This object represents a voice note.
+
+
+
+
+ Duration of the audio in seconds as defined by sender
+
+
+
+
+ Optional. MIME type of the file as defined by sender
+
+
+
+
+ Contains data sent from a Web App to the bot.
+
+
+
+
+ The data. Be aware that a bad client can send arbitrary data in this field.
+
+
+
+
+ Text of the web_app keyboard button, from which the Web App was opened. Be aware that a bad client can
+ send arbitrary data in this field.
+
+
+
+
+ Contains information about a Web App
+
+
+
+
+ An HTTPS URL of a Web App to be opened with additional data as specified in
+ Initializing Web Apps
+
+
+
+
+ Contains information about the current status of a webhook.
+
+
+
+
+ Webhook URL, may be empty if webhook is not set up
+
+
+
+
+ , if a custom certificate was provided for webhook certificate checks
+
+
+
+
+ Number of updates awaiting delivery
+
+
+
+
+ Optional. Currently used webhook IP address
+
+
+
+
+ Optional. Time for the most recent error that happened when trying to deliver an update via webhook
+
+
+
+
+ Optional. Error message in human-readable format for the most recent error that happened when trying to
+ deliver an update via webhook
+
+
+
+
+ Optional. Unix time of the most recent error that happened when trying to synchronize available updates
+ with Telegram datacenters
+
+
+
+
+ Optional. Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery
+
+
+
+
+ Optional. A list of update types the bot is subscribed to. Defaults to all update types except
+
+
+
+
+
+ This object represents a service message about a user allowing a bot to write messages
+ after adding the bot to the attachment menu or launching a Web App from a link.
+
+
+
+
+ Optional. Name of the Web App which was launched from a link
+
+
+
+
diff --git a/TelegramBotBase.SourceGenerators/TelegramBotBase.SourceGenerators.csproj b/TelegramBotBase.SourceGenerators/TelegramBotBase.SourceGenerators.csproj
new file mode 100644
index 0000000..b262ac0
--- /dev/null
+++ b/TelegramBotBase.SourceGenerators/TelegramBotBase.SourceGenerators.csproj
@@ -0,0 +1,25 @@
+
+
+
+ netstandard2.0
+ disable
+ enable
+ true
+ Analyzer
+ false
+ latest
+
+
+
+
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+
diff --git a/TelegramBotBase.SourceGenerators/TelegramDeviceExtensionGenerator.cs b/TelegramBotBase.SourceGenerators/TelegramDeviceExtensionGenerator.cs
new file mode 100644
index 0000000..ec63728
--- /dev/null
+++ b/TelegramBotBase.SourceGenerators/TelegramDeviceExtensionGenerator.cs
@@ -0,0 +1,251 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using System.Reflection.Metadata;
+using System.Resources;
+using System.Security.Cryptography.X509Certificates;
+using System.Text;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Text;
+using TelegramBotBase.SourceGenerators;
+
+namespace TelegramBotBase
+{
+
+ [Generator(LanguageNames.CSharp)]
+ public class TelegramDeviceExtensionGenerator : IIncrementalGenerator
+ {
+ static XmlDocumentationLoader xml;
+
+
+ public void Initialize(IncrementalGeneratorInitializationContext context)
+ {
+ var provider = context.SyntaxProvider.CreateSyntaxProvider(
+ predicate: (c, _) => c is ClassDeclarationSyntax,
+ transform: (n, _) => (ClassDeclarationSyntax)n.Node)
+ .Where(a => a is not null);
+
+
+ var compilation = context.CompilationProvider;
+
+ context.RegisterSourceOutput(compilation, (spc, source) => Execute(spc, source));
+
+
+
+ }
+
+
+ private void Execute(SourceProductionContext context, Compilation compilation)
+ {
+ //if (!Debugger.IsAttached) Debugger.Launch();
+
+ StringBuilder sb = new StringBuilder();
+ sb.AppendLine();
+
+ //Search for reference library
+ var telegram_package = compilation.References.FirstOrDefault(a => a.Display != null && a.Display.Contains("Telegram.Bot"));
+ if (telegram_package == null)
+ return;
+
+
+
+ //Load only once
+ if (xml == null)
+ {
+ xml = new XmlDocumentationLoader();
+ xml.ReadEmbeddedXml("Telegram.Bot.xml");
+ }
+
+ var assemblySymbol = compilation.GetAssemblyOrModuleSymbol(telegram_package) as IAssemblySymbol;
+
+ if (assemblySymbol == null)
+ return;
+
+ if (assemblySymbol.Name != "Telegram.Bot")
+ return;
+
+ //Get class which includes the existing methods
+ var apiClass = assemblySymbol.GetTypeByMetadataName("Telegram.Bot.TelegramBotClientExtensions");
+ if (apiClass == null)
+ return;
+
+ //Get existing list of methods
+ var methods = apiClass.GetMembers().OfType().ToList();
+
+
+ foreach (var method in methods)
+ {
+ if (!method.Parameters.Any(a => a.Type.Name == "ITelegramBotClient"))
+ continue;
+
+ if (!method.Parameters.Any(a => a.Type.Name == "ChatId"))
+ continue;
+
+ if (method.Name == ".ctor")
+ continue;
+
+ String parameters = "";
+ String subCallParameters = "";
+ foreach (var par in method.Parameters)
+ {
+ if (par.Name == "botClient")
+ continue;
+
+ if (!string.IsNullOrEmpty(parameters))
+ {
+ parameters += ", ";
+ }
+
+ if (!string.IsNullOrEmpty(subCallParameters))
+ {
+ subCallParameters += ", ";
+ }
+
+ if (par.Name == "chatId")
+ {
+ subCallParameters += $"device.DeviceId";
+ continue;
+ }
+
+ subCallParameters += $"{par.Name}";
+ parameters += $"{par.Type.ToDisplayString()} {par.Name}";
+
+ if (par.HasExplicitDefaultValue)
+ {
+ var defaultValue = par.ExplicitDefaultValue;
+
+ // Handle specific default value cases
+ if (defaultValue == null)
+ {
+ if(par.Name == "cancellationToken")
+ {
+ parameters += " = default";
+ }
+ else
+ {
+ parameters += " = null";
+ }
+
+
+ }
+ else if (defaultValue is string)
+ {
+ parameters += $" = \"{defaultValue}\""; // Add quotes around string default values
+ }
+ else if (defaultValue is bool)
+ {
+ parameters += $" = {defaultValue.ToString().ToLower()}"; // Use lower case for booleans (true/false)
+ }
+ else if (defaultValue is char)
+ {
+ parameters += $" = '{defaultValue}'"; // Use single quotes for char
+ }
+ else
+ {
+ parameters += $" = {defaultValue}"; // General case for other types (numbers, enums, etc.)
+ }
+ }
+
+
+ }
+
+
+ var returnStatement = "";
+
+ if (method.ReturnType is INamedTypeSymbol namedType && namedType.IsGenericType && namedType.ConstructedFrom.Name == "Task" && namedType.ContainingNamespace.ToDisplayString() == "System.Threading.Tasks")
+ {
+ returnStatement = "return await";
+ }
+ else if (method.ReturnType.Name == "Task" && method.ReturnType.ContainingNamespace.ToDisplayString() == "System.Threading.Tasks")
+ {
+ returnStatement = "await";
+ }
+ else if (method.ReturnsVoid)
+ {
+ returnStatement = "";
+ }
+ else
+ {
+ returnStatement = "return ";
+ }
+
+ String tmp = GenerateMethod(method, parameters, subCallParameters, returnStatement);
+
+ sb.Append(tmp);
+
+ }
+
+
+
+
+ //The generated source
+ var sourceCode = $$"""
+ using System;
+ using System.Threading.Tasks;
+ using TelegramBotBase.Interfaces;
+ using TelegramBotBase.Sessions;
+ using Telegram.Bot;
+ using Telegram.Bot.Extensions;
+ using Telegram.Bot.Requests;
+ using Telegram.Bot.Types.Enums;
+ using Telegram.Bot.Types.InlineQueryResults;
+ using Telegram.Bot.Types.Payments;
+ using Telegram.Bot.Types.ReplyMarkups;
+ using File = Telegram.Bot.Types.File;
+
+ #nullable enable
+ namespace TelegramBotBase;
+
+ public static class DeviceExtensions
+ {
+ {{sb.ToString()}}
+ }
+
+ """;
+
+ //Cleanup
+ sourceCode = sourceCode.Replace("System.Threading.Tasks.", "");
+
+
+ context.AddSource("DeviceExtensions.g.cs", SourceText.From(sourceCode, Encoding.UTF8));
+
+ }
+
+ ///
+ /// Test
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ private String GenerateMethod(IMethodSymbol? method, string parameters, string subCallParameters, string returnStatement)
+ {
+ //Adding xml comments from embedded xml file (Workaround)
+ String xml_comments = xml?.GetDocumentationLinesForSymbol(method);
+
+ StringBuilder sb = new StringBuilder();
+
+ sb.AppendLine(xml_comments);
+
+ sb.AppendLine($" public static async {method.ReturnType.ToDisplayString()} {method.Name}(this IDeviceSession device, {parameters})");
+
+ sb.AppendLine($" {{");
+
+ sb.AppendLine($" {returnStatement} device.Client.TelegramClient.{method.Name}({subCallParameters});");
+
+ sb.AppendLine($" }}");
+
+ sb.AppendLine();
+
+ sb.AppendLine();
+
+ return sb.ToString();
+ }
+ }
+}
\ No newline at end of file
diff --git a/TelegramBotBase.SourceGenerators/XmlDocumentationLoader.cs b/TelegramBotBase.SourceGenerators/XmlDocumentationLoader.cs
new file mode 100644
index 0000000..1edb207
--- /dev/null
+++ b/TelegramBotBase.SourceGenerators/XmlDocumentationLoader.cs
@@ -0,0 +1,89 @@
+using Microsoft.CodeAnalysis;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Xml.Linq;
+using System.Xml.XPath;
+
+namespace TelegramBotBase.SourceGenerators
+{
+ public class XmlDocumentationLoader
+ {
+ XDocument xDocument;
+
+ public string GetDocumentationLinesForSymbol(ISymbol symbol)
+ {
+ var docElement = xDocument?.Descendants("member")
+ .FirstOrDefault(e => e.Attribute("name")?.Value == GetDocumentationCommentId(symbol));
+
+
+ StringBuilder sb = new StringBuilder();
+
+ XNode first = docElement.FirstNode;
+ do
+ {
+ sb.AppendLine(first.ToString());
+
+
+
+ first = first.NextNode;
+
+ }
+ while (first.NextNode != null);
+
+ var lines = sb.ToString().Split('\n');
+
+ sb = new StringBuilder();
+
+ foreach (var line in lines)
+ {
+ if (line == "")
+ continue;
+
+ sb.AppendLine($" /// {line.Trim()}");
+
+
+ }
+
+
+ return sb.ToString().Trim();
+ }
+
+ private string GetDocumentationCommentId(ISymbol symbol)
+ {
+ // Returns the documentation comment ID for a symbol
+ return symbol.GetDocumentationCommentId();
+ }
+
+ public XDocument ReadEmbeddedXml(string resourceName)
+ {
+ // Get the assembly where the resource is embedded
+ Assembly assembly = Assembly.GetExecutingAssembly();
+
+ // Construct the full resource name
+ string fullResourceName = $"{assembly.GetName().Name}.Resources.{resourceName}";
+
+ var names = assembly.GetManifestResourceNames();
+
+ if (!names.Contains(fullResourceName))
+ return null;
+
+ // Open a stream to the embedded resource
+ using (Stream stream = assembly.GetManifestResourceStream(fullResourceName))
+ {
+ if (stream == null)
+ {
+ //throw new FileNotFoundException("Resource not found", fullResourceName);
+ return null;
+ }
+
+ xDocument = XDocument.Load(stream);
+ // Load the stream into an XDocument
+ return xDocument;
+ }
+ }
+ }
+}
diff --git a/TelegramBotBase.Test/Tests/DataSources/CustomDataSource.cs b/TelegramBotBase.Test/Tests/DataSources/CustomDataSource.cs
index 079d448..1878781 100644
--- a/TelegramBotBase.Test/Tests/DataSources/CustomDataSource.cs
+++ b/TelegramBotBase.Test/Tests/DataSources/CustomDataSource.cs
@@ -3,7 +3,7 @@
using System.Globalization;
using System.IO;
using System.Linq;
-using Newtonsoft.Json;
+using System.Text.Json;
using TelegramBotBase.Controls.Hybrid;
using TelegramBotBase.DataSources;
using TelegramBotBase.Form;
@@ -36,7 +36,7 @@ private void LoadData()
{
try
{
- var list = JsonConvert.DeserializeObject>(File.ReadAllText("countries.json"));
+ var list = JsonSerializer.Deserialize>(File.ReadAllText("countries.json"));
Countries = list;
@@ -56,7 +56,7 @@ private void LoadData()
Countries = countries;
- var tmp = JsonConvert.SerializeObject(countries);
+ var tmp = JsonSerializer.Serialize(countries);
File.WriteAllText(AppContext.BaseDirectory + "countries.json", tmp);
}
diff --git a/TelegramBotBase/Args/BotCommandEventArgs.cs b/TelegramBotBase/Args/BotCommandEventArgs.cs
index 02ec9d8..0b9f4d9 100644
--- a/TelegramBotBase/Args/BotCommandEventArgs.cs
+++ b/TelegramBotBase/Args/BotCommandEventArgs.cs
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using Telegram.Bot.Types;
-using TelegramBotBase.Sessions;
+using TelegramBotBase.Interfaces;
namespace TelegramBotBase.Args;
@@ -15,7 +15,7 @@ public BotCommandEventArgs()
}
public BotCommandEventArgs(string command, List parameters, Message message, long deviceId,
- DeviceSession device)
+ IDeviceSession device)
{
Command = command;
Parameters = parameters;
@@ -30,7 +30,7 @@ public BotCommandEventArgs(string command, List parameters, Message mess
public long DeviceId { get; set; }
- public DeviceSession Device { get; set; }
+ public IDeviceSession Device { get; set; }
public bool Handled { get; set; } = false;
diff --git a/TelegramBotBase/Args/MessageIncomeEventArgs.cs b/TelegramBotBase/Args/MessageIncomeEventArgs.cs
index ddc0ac8..224cf67 100644
--- a/TelegramBotBase/Args/MessageIncomeEventArgs.cs
+++ b/TelegramBotBase/Args/MessageIncomeEventArgs.cs
@@ -1,11 +1,11 @@
using System;
-using TelegramBotBase.Sessions;
+using TelegramBotBase.Interfaces;
namespace TelegramBotBase.Base;
public class MessageIncomeEventArgs : EventArgs
{
- public MessageIncomeEventArgs(long deviceId, DeviceSession device, MessageResult message)
+ public MessageIncomeEventArgs(long deviceId, IDeviceSession device, MessageResult message)
{
DeviceId = deviceId;
Device = device;
@@ -14,7 +14,7 @@ public MessageIncomeEventArgs(long deviceId, DeviceSession device, MessageResult
public long DeviceId { get; set; }
- public DeviceSession Device { get; set; }
+ public IDeviceSession Device { get; set; }
public MessageResult Message { get; set; }
}
\ No newline at end of file
diff --git a/TelegramBotBase/Args/SessionBeginEventArgs.cs b/TelegramBotBase/Args/SessionBeginEventArgs.cs
index 53a54b9..05ed68a 100644
--- a/TelegramBotBase/Args/SessionBeginEventArgs.cs
+++ b/TelegramBotBase/Args/SessionBeginEventArgs.cs
@@ -1,11 +1,11 @@
using System;
-using TelegramBotBase.Sessions;
+using TelegramBotBase.Interfaces;
namespace TelegramBotBase.Base;
public class SessionBeginEventArgs : EventArgs
{
- public SessionBeginEventArgs(long deviceId, DeviceSession device)
+ public SessionBeginEventArgs(long deviceId, IDeviceSession device)
{
DeviceId = deviceId;
Device = device;
@@ -13,5 +13,5 @@ public SessionBeginEventArgs(long deviceId, DeviceSession device)
public long DeviceId { get; set; }
- public DeviceSession Device { get; set; }
+ public IDeviceSession Device { get; set; }
}
\ No newline at end of file
diff --git a/TelegramBotBase/Args/SystemExceptionEventArgs.cs b/TelegramBotBase/Args/SystemExceptionEventArgs.cs
index 5fbaf69..7b95290 100644
--- a/TelegramBotBase/Args/SystemExceptionEventArgs.cs
+++ b/TelegramBotBase/Args/SystemExceptionEventArgs.cs
@@ -1,5 +1,5 @@
using System;
-using TelegramBotBase.Sessions;
+using TelegramBotBase.Interfaces;
namespace TelegramBotBase.Args;
@@ -9,7 +9,7 @@ public SystemExceptionEventArgs()
{
}
- public SystemExceptionEventArgs(string command, long deviceId, DeviceSession device, Exception error)
+ public SystemExceptionEventArgs(string command, long deviceId, IDeviceSession device, Exception error)
{
Command = command;
DeviceId = deviceId;
@@ -21,7 +21,7 @@ public SystemExceptionEventArgs(string command, long deviceId, DeviceSession dev
public long DeviceId { get; set; }
- public DeviceSession Device { get; set; }
+ public IDeviceSession Device { get; set; }
public Exception Error { get; set; }
}
\ No newline at end of file
diff --git a/TelegramBotBase/Args/UnhandledCallEventArgs.cs b/TelegramBotBase/Args/UnhandledCallEventArgs.cs
index 844bc43..8b60703 100644
--- a/TelegramBotBase/Args/UnhandledCallEventArgs.cs
+++ b/TelegramBotBase/Args/UnhandledCallEventArgs.cs
@@ -1,6 +1,6 @@
using System;
using Telegram.Bot.Types;
-using TelegramBotBase.Sessions;
+using TelegramBotBase.Interfaces;
namespace TelegramBotBase.Args;
@@ -12,7 +12,7 @@ public UnhandledCallEventArgs()
}
public UnhandledCallEventArgs(string command, string rawData, long deviceId, int messageId, Message message,
- DeviceSession device) : this()
+ IDeviceSession device) : this()
{
Command = command;
RawData = rawData;
@@ -26,7 +26,7 @@ public UnhandledCallEventArgs(string command, string rawData, long deviceId, int
public long DeviceId { get; set; }
- public DeviceSession Device { get; set; }
+ public IDeviceSession Device { get; set; }
public string RawData { get; set; }
diff --git a/TelegramBotBase/Base/ControlBase.cs b/TelegramBotBase/Base/ControlBase.cs
index 4c25177..3e604aa 100644
--- a/TelegramBotBase/Base/ControlBase.cs
+++ b/TelegramBotBase/Base/ControlBase.cs
@@ -1,5 +1,5 @@
using System.Threading.Tasks;
-using TelegramBotBase.Sessions;
+using TelegramBotBase.Interfaces;
namespace TelegramBotBase.Base;
@@ -8,7 +8,7 @@ namespace TelegramBotBase.Base;
///
public class ControlBase
{
- public DeviceSession Device { get; set; }
+ public IDeviceSession Device { get; set; }
public int Id { get; set; }
diff --git a/TelegramBotBase/Base/FormBase.cs b/TelegramBotBase/Base/FormBase.cs
index 160952f..823e1b7 100644
--- a/TelegramBotBase/Base/FormBase.cs
+++ b/TelegramBotBase/Base/FormBase.cs
@@ -6,7 +6,7 @@
using TelegramBotBase.Args;
using TelegramBotBase.Base;
using TelegramBotBase.Form.Navigation;
-using TelegramBotBase.Sessions;
+using TelegramBotBase.Interfaces;
using static TelegramBotBase.Base.Async;
namespace TelegramBotBase.Form;
@@ -28,7 +28,7 @@ public class FormBase : IDisposable
public NavigationController NavigationController { get; set; }
- public DeviceSession Device { get; set; }
+ public IDeviceSession Device { get; set; }
public MessageClient Client { get; set; }
diff --git a/TelegramBotBase/Base/MessageClient.cs b/TelegramBotBase/Base/MessageClient.cs
index 5d82f8d..3999bdd 100644
--- a/TelegramBotBase/Base/MessageClient.cs
+++ b/TelegramBotBase/Base/MessageClient.cs
@@ -111,7 +111,7 @@ public virtual void StartReceiving()
public virtual void StopReceiving()
{
- _cancellationTokenSource.Cancel();
+ _cancellationTokenSource?.Cancel();
}
diff --git a/TelegramBotBase/Base/MessageResult.cs b/TelegramBotBase/Base/MessageResult.cs
index f1224c3..7cd2553 100644
--- a/TelegramBotBase/Base/MessageResult.cs
+++ b/TelegramBotBase/Base/MessageResult.cs
@@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Text.Json;
using System.Threading.Tasks;
-using Newtonsoft.Json;
using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums;
@@ -126,7 +126,7 @@ public T GetData()
T cd = null;
try
{
- cd = JsonConvert.DeserializeObject(RawData);
+ cd = JsonSerializer.Deserialize(RawData);
return cd;
}
diff --git a/TelegramBotBase/Base/ResultBase.cs b/TelegramBotBase/Base/ResultBase.cs
index 69a4f74..1df1859 100644
--- a/TelegramBotBase/Base/ResultBase.cs
+++ b/TelegramBotBase/Base/ResultBase.cs
@@ -2,13 +2,13 @@
using System.Threading.Tasks;
using Telegram.Bot;
using Telegram.Bot.Types;
-using TelegramBotBase.Sessions;
+using TelegramBotBase.Interfaces;
namespace TelegramBotBase.Base;
public class ResultBase : EventArgs
{
- public DeviceSession Device { get; set; }
+ public IDeviceSession Device { get; set; }
public virtual long DeviceId { get; set; }
diff --git a/TelegramBotBase/Base/ThreadPoolMessageClient.cs b/TelegramBotBase/Base/ThreadPoolMessageClient.cs
index 41fb131..c70fc9d 100644
--- a/TelegramBotBase/Base/ThreadPoolMessageClient.cs
+++ b/TelegramBotBase/Base/ThreadPoolMessageClient.cs
@@ -81,7 +81,7 @@ public override void StartReceiving()
public override void StopReceiving()
{
- _cancellationTokenSource.Cancel();
+ _cancellationTokenSource?.Cancel();
}
diff --git a/TelegramBotBase/Base/UpdateResult.cs b/TelegramBotBase/Base/UpdateResult.cs
index de41c0a..ab172d5 100644
--- a/TelegramBotBase/Base/UpdateResult.cs
+++ b/TelegramBotBase/Base/UpdateResult.cs
@@ -1,11 +1,11 @@
using Telegram.Bot.Types;
-using TelegramBotBase.Sessions;
+using TelegramBotBase.Interfaces;
namespace TelegramBotBase.Base;
public class UpdateResult : ResultBase
{
- public UpdateResult(Update rawData, DeviceSession device)
+ public UpdateResult(Update rawData, IDeviceSession device)
{
RawData = rawData;
Device = device;
diff --git a/TelegramBotBase/Builder/BotBaseBuilder.cs b/TelegramBotBase/Builder/BotBaseBuilder.cs
index 3d95e75..78d0260 100644
--- a/TelegramBotBase/Builder/BotBaseBuilder.cs
+++ b/TelegramBotBase/Builder/BotBaseBuilder.cs
@@ -333,6 +333,7 @@ public ILanguageSelectionStage UseSerialization(IStateMachine machine)
///
/// Uses the application runtime path to load and write a states.json file.
///
+ /// For the legacy version use the UseNewtonsoftJson method of TelegramBotBase.Extensions.Serializer.Legacy.NewtonsoftJson
///
public ILanguageSelectionStage UseJSON()
{
@@ -344,6 +345,7 @@ public ILanguageSelectionStage UseJSON()
///
/// Uses the given path to load and write a states.json file.
///
+ /// For the legacy version use the UseNewtonsoftJson method of TelegramBotBase.Extensions.Serializer.Legacy.NewtonsoftJson
///
public ILanguageSelectionStage UseJSON(string path)
{
diff --git a/TelegramBotBase/Builder/Interfaces/ISessionSerializationStage.cs b/TelegramBotBase/Builder/Interfaces/ISessionSerializationStage.cs
index 2a453e4..e4991c2 100644
--- a/TelegramBotBase/Builder/Interfaces/ISessionSerializationStage.cs
+++ b/TelegramBotBase/Builder/Interfaces/ISessionSerializationStage.cs
@@ -1,4 +1,5 @@
-using TelegramBotBase.Interfaces;
+using System;
+using TelegramBotBase.Interfaces;
namespace TelegramBotBase.Builder.Interfaces;
@@ -22,15 +23,32 @@ public interface ISessionSerializationStage
/// Using the complex version of .Net JSON, which can serialize all objects.
/// Saves in application directory.
///
+ ///
+ ///
+ /// Has been changed lately to not use Newtonsoft.Json anymore.
+ /// For the legacy version add the nuget package below and use the method.
+ ///
+ /// For the legacy version use the UseNewtonsoftJson method of TelegramBotBase.Extensions.Serializer.Legacy.NewtonsoftJson
+ ///
///
///
+ ///
ILanguageSelectionStage UseJSON();
///
/// Using the complex version of .Net JSON, which can serialize all objects.
+ /// Saves in application directory.
///
+ ///
+ ///
+ /// Has been changed lately to not use Newtonsoft.Json anymore.
+ /// For the legacy version add the nuget package below and use the method.
+ ///
+ /// For the legacy version use the UseNewtonsoftJson method of TelegramBotBase.Extensions.Serializer.Legacy.NewtonsoftJson
+ ///
///
///
+ ///
ILanguageSelectionStage UseJSON(string path);
///
@@ -39,6 +57,7 @@ public interface ISessionSerializationStage
///
///
///
+ [Obsolete("Use UseJSON instead.")]
ILanguageSelectionStage UseSimpleJSON();
///
@@ -46,6 +65,7 @@ public interface ISessionSerializationStage
///
///
///
+ [Obsolete("Use UseJSON instead.")]
ILanguageSelectionStage UseSimpleJSON(string path);
///
diff --git a/TelegramBotBase/Form/CallbackData.cs b/TelegramBotBase/Form/CallbackData.cs
index 13b701a..e9143fe 100644
--- a/TelegramBotBase/Form/CallbackData.cs
+++ b/TelegramBotBase/Form/CallbackData.cs
@@ -1,16 +1,18 @@
-using Newtonsoft.Json;
+using System.Text.Json;
using System.Text;
using TelegramBotBase.Exceptions;
+using System.Text.Json.Serialization;
namespace TelegramBotBase.Form;
///
-/// Base class for serializing buttons and data
+/// Base class for serializing buttons and data
///
public class CallbackData
{
public CallbackData()
{
+
}
public CallbackData(string method, string value)
@@ -19,9 +21,9 @@ public CallbackData(string method, string value)
Value = value;
}
- [JsonProperty("m")] public string Method { get; set; }
+ [JsonPropertyName("m")] public string Method { get; set; }
- [JsonProperty("v")] public string Value { get; set; }
+ [JsonPropertyName("v")] public string Value { get; set; }
public static string Create(string method, string value)
{
@@ -36,7 +38,7 @@ public string Serialize(bool throwExceptionOnOverflow = false)
{
var s = string.Empty;
- s = JsonConvert.SerializeObject(this);
+ s = JsonSerializer.Serialize(this);
//Is data over 64 bytes ?
int byte_count = Encoding.UTF8.GetByteCount(s);
@@ -55,7 +57,7 @@ public string Serialize(bool throwExceptionOnOverflow = false)
///
public static CallbackData Deserialize(string data)
{
- return JsonConvert.DeserializeObject(data);
+ return JsonSerializer.Deserialize(data);
}
public static implicit operator string(CallbackData callbackData) => callbackData.Serialize(true);
diff --git a/TelegramBotBase/Form/GroupForm.cs b/TelegramBotBase/Form/GroupForm.cs
index 14002f9..4cc3a1f 100644
--- a/TelegramBotBase/Form/GroupForm.cs
+++ b/TelegramBotBase/Form/GroupForm.cs
@@ -1,4 +1,5 @@
-using System.Threading.Tasks;
+using System;
+using System.Threading.Tasks;
using Telegram.Bot.Types.Enums;
using TelegramBotBase.Args;
using TelegramBotBase.Base;
@@ -7,6 +8,8 @@ namespace TelegramBotBase.Form;
public class GroupForm : FormBase
{
+ //Prior V21
+ [Obsolete("Check Telegram.Bot nuget package changes.")]
public override async Task Load(MessageResult message)
{
switch (message.MessageType)
@@ -46,6 +49,46 @@ await OnMemberChanges(new MemberChangeEventArgs(MessageType.ChatMemberLeft, mess
}
}
+ //Past V21
+ //public override async Task Load(MessageResult message)
+ //{
+ // switch (message.MessageType)
+ // {
+ // case MessageType.NewChatMembers:
+
+ // await OnMemberChanges(new MemberChangeEventArgs(MessageType.NewChatMembers, message,
+ // message.Message.NewChatMembers));
+
+ // break;
+ // case MessageType.LeftChatMember:
+
+ // await OnMemberChanges(new MemberChangeEventArgs(MessageType.LeftChatMember, message,
+ // message.Message.LeftChatMember));
+
+ // break;
+
+ // case MessageType.NewChatPhoto:
+ // case MessageType.DeleteChatPhoto:
+ // case MessageType.NewChatTitle:
+ // case MessageType.MigrateFromChatId:
+ // case MessageType.MigrateToChatId:
+ // case MessageType.PinnedMessage:
+ // case MessageType.GroupChatCreated:
+ // case MessageType.SupergroupChatCreated:
+ // case MessageType.ChannelChatCreated:
+
+ // await OnGroupChanged(new GroupChangedEventArgs(message.MessageType, message));
+
+ // break;
+
+ // default:
+
+ // await OnMessage(message);
+
+ // break;
+ // }
+ //}
+
public override async Task Edited(MessageResult message)
{
await OnMessageEdit(message);
diff --git a/TelegramBotBase/Form/PromptDialog.cs b/TelegramBotBase/Form/PromptDialog.cs
index a2d4c56..1d2d5f4 100644
--- a/TelegramBotBase/Form/PromptDialog.cs
+++ b/TelegramBotBase/Form/PromptDialog.cs
@@ -82,7 +82,7 @@ public override async Task Render(MessageResult message)
{
var bf = new ButtonForm();
bf.AddButtonRow(new ButtonBase(BackLabel, "back"));
- await Device.Send(Message, (ReplyMarkupBase)bf);
+ await Device.Send(Message, (IReplyMarkup)bf);
return;
}
diff --git a/TelegramBotBase/Interfaces/IDeviceSession.cs b/TelegramBotBase/Interfaces/IDeviceSession.cs
index 8e0d95a..3b3b2d0 100644
--- a/TelegramBotBase/Interfaces/IDeviceSession.cs
+++ b/TelegramBotBase/Interfaces/IDeviceSession.cs
@@ -1,10 +1,24 @@
using System;
+using System.Threading.Tasks;
+using Telegram.Bot.Types.Enums;
+using Telegram.Bot.Types;
using TelegramBotBase.Form;
+using Telegram.Bot.Types.ReplyMarkups;
+using TelegramBotBase.Args;
+using TelegramBotBase.Base;
+using Telegram.Bot;
+using TelegramBotBase.Sessions;
namespace TelegramBotBase.Interfaces;
-internal interface IDeviceSession
+public interface IDeviceSession : IDeviceSessionMethods
{
+ MessageClient Client => ActiveForm.Client;
+
+ int LastMessageId => LastMessage?.MessageId ?? -1;
+
+ Message LastMessage { get; set; }
+
///
/// Device or chat id
///
@@ -35,4 +49,6 @@ internal interface IDeviceSession
/// contains if the form has been switched (navigated)
///
bool FormSwitched { get; set; }
+
+
}
\ No newline at end of file
diff --git a/TelegramBotBase/Interfaces/IDeviceSessionMethods.cs b/TelegramBotBase/Interfaces/IDeviceSessionMethods.cs
new file mode 100644
index 0000000..8b68911
--- /dev/null
+++ b/TelegramBotBase/Interfaces/IDeviceSessionMethods.cs
@@ -0,0 +1,117 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Threading.Tasks;
+using Telegram.Bot.Types.Enums;
+using Telegram.Bot.Types.ReplyMarkups;
+using Telegram.Bot.Types;
+using TelegramBotBase.Form;
+using Telegram.Bot;
+using TelegramBotBase.Base;
+using TelegramBotBase.Args;
+
+namespace TelegramBotBase.Interfaces
+{
+ public interface IDeviceSessionMethods
+ {
+
+ string GetChatTitle();
+
+ Task BanUser(long userId, DateTime until = default);
+
+ Task UnbanUser(long userId);
+
+ Task ChangeChatPermissions(ChatPermissions permissions);
+
+ Task RestrictUser(long userId, ChatPermissions permissions, bool? useIndependentGroupPermission = null, DateTime until = default);
+
+ Task ConfirmAction(string callbackQueryId, string message = "", bool showAlert = false,
+ string urlToOpen = null);
+
+ Task DeleteMessage(int messageId = -1);
+
+ Task DeleteMessage(Message message);
+
+ Task HideReplyKeyboard(string closedMsg = "Closed", bool autoDeleteResponse = true);
+
+ Task Send(string text, ButtonForm buttons = null, int replyTo = 0,
+ bool disableNotification = false, ParseMode parseMode = ParseMode.Markdown,
+ bool markdownV2AutoEscape = true);
+
+ Task Send(string text, IReplyMarkup markup, int replyTo = 0,
+ bool disableNotification = false, ParseMode parseMode = ParseMode.Markdown,
+ bool markdownV2AutoEscape = true);
+
+ Task Send(string text, InlineKeyboardMarkup markup, int replyTo = 0,
+ bool disableNotification = false, ParseMode parseMode = ParseMode.Markdown,
+ bool markdownV2AutoEscape = true);
+
+ Task SetAction(ChatAction action);
+
+ Task SendTextFile(string filename, string textcontent, Encoding encoding = null,
+ string caption = "", ButtonForm buttons = null, int replyTo = 0,
+ bool disableNotification = false);
+
+ Task SendDocument(InputFile document, string caption = "",
+ ButtonForm buttons = null, int replyTo = 0,
+ bool disableNotification = false);
+
+
+ Task SendPhoto(InputFile file, string caption = null, ButtonForm buttons = null,
+ int replyTo = 0, bool disableNotification = false,
+ ParseMode parseMode = ParseMode.Markdown);
+
+ Task SendVideo(InputFile file, string caption = null, ButtonForm buttons = null,
+ int replyTo = 0, bool disableNotification = false,
+ ParseMode parseMode = ParseMode.Markdown);
+
+
+ Task SendVideo(string url, ButtonForm buttons = null, int replyTo = 0,
+ bool disableNotification = false, ParseMode parseMode = ParseMode.Markdown);
+
+ Task SendVideo(string filename, byte[] video, ButtonForm buttons = null, int replyTo = 0,
+ bool disableNotification = false, ParseMode parseMode = ParseMode.Markdown);
+
+ Task SendLocalVideo(string filepath, ButtonForm buttons = null, int replyTo = 0,
+ bool disableNotification = false,
+ ParseMode parseMode = ParseMode.Markdown);
+
+ Task Edit(int messageId, string text, ButtonForm buttons = null,
+ ParseMode parseMode = ParseMode.Markdown);
+
+
+
+ Task Edit(int messageId, string text, InlineKeyboardMarkup markup,
+ ParseMode parseMode = ParseMode.Markdown);
+
+ Task Edit(Message message, ButtonForm buttons = null,
+ ParseMode parseMode = ParseMode.Markdown);
+
+ Task EditReplyMarkup(int messageId, ButtonForm bf);
+
+ Task RequestContact(string buttonText = "Send your contact",
+ string requestMessage = "Give me your phone number!",
+ bool oneTimeOnly = true);
+
+ Task RequestLocation(string buttonText = "Send your location",
+ string requestMessage = "Give me your location!",
+ bool oneTimeOnly = true);
+
+
+ Task GetChatUser(long userId);
+
+
+ event Async.AsyncEventHandler MessageSent;
+
+ event EventHandler MessageReceived;
+
+ event EventHandler MessageDeleted;
+
+ Task Api(Func call);
+
+ Task Api(Func> call);
+
+ T Raw(Func call);
+
+ }
+}
diff --git a/TelegramBotBase/Interfaces/IMessageLoopFactory.cs b/TelegramBotBase/Interfaces/IMessageLoopFactory.cs
index 951b7fa..b2b9eac 100644
--- a/TelegramBotBase/Interfaces/IMessageLoopFactory.cs
+++ b/TelegramBotBase/Interfaces/IMessageLoopFactory.cs
@@ -2,13 +2,12 @@
using System.Threading.Tasks;
using TelegramBotBase.Args;
using TelegramBotBase.Base;
-using TelegramBotBase.Sessions;
namespace TelegramBotBase.Interfaces;
public interface IMessageLoopFactory
{
- Task MessageLoop(BotBase bot, DeviceSession session, UpdateResult ur, MessageResult e);
+ Task MessageLoop(BotBase bot, IDeviceSession session, UpdateResult ur, MessageResult e);
event EventHandler UnhandledCall;
}
\ No newline at end of file
diff --git a/TelegramBotBase/MessageLoops/FormBaseMessageLoop.cs b/TelegramBotBase/MessageLoops/FormBaseMessageLoop.cs
index bdc6374..d60f7bd 100644
--- a/TelegramBotBase/MessageLoops/FormBaseMessageLoop.cs
+++ b/TelegramBotBase/MessageLoops/FormBaseMessageLoop.cs
@@ -5,7 +5,6 @@
using TelegramBotBase.Args;
using TelegramBotBase.Base;
using TelegramBotBase.Interfaces;
-using TelegramBotBase.Sessions;
namespace TelegramBotBase.MessageLoops;
@@ -18,7 +17,7 @@ public class FormBaseMessageLoop : IMessageLoopFactory
private readonly EventHandlerList _events = new();
- public async Task MessageLoop(BotBase bot, DeviceSession session, UpdateResult ur, MessageResult mr)
+ public async Task MessageLoop(BotBase bot, IDeviceSession session, UpdateResult ur, MessageResult mr)
{
var update = ur.RawData;
diff --git a/TelegramBotBase/MessageLoops/FullMessageLoop.cs b/TelegramBotBase/MessageLoops/FullMessageLoop.cs
index a0c1c51..22a390f 100644
--- a/TelegramBotBase/MessageLoops/FullMessageLoop.cs
+++ b/TelegramBotBase/MessageLoops/FullMessageLoop.cs
@@ -5,7 +5,6 @@
using TelegramBotBase.Args;
using TelegramBotBase.Base;
using TelegramBotBase.Interfaces;
-using TelegramBotBase.Sessions;
namespace TelegramBotBase.MessageLoops;
@@ -18,7 +17,7 @@ public class FullMessageLoop : IMessageLoopFactory
private readonly EventHandlerList _events = new();
- public async Task MessageLoop(BotBase bot, DeviceSession session, UpdateResult ur, MessageResult mr)
+ public async Task MessageLoop(BotBase bot, IDeviceSession session, UpdateResult ur, MessageResult mr)
{
var update = ur.RawData;
diff --git a/TelegramBotBase/MessageLoops/MinimalMessageLoop.cs b/TelegramBotBase/MessageLoops/MinimalMessageLoop.cs
index 8f72f15..c87b393 100644
--- a/TelegramBotBase/MessageLoops/MinimalMessageLoop.cs
+++ b/TelegramBotBase/MessageLoops/MinimalMessageLoop.cs
@@ -4,7 +4,6 @@
using TelegramBotBase.Args;
using TelegramBotBase.Base;
using TelegramBotBase.Interfaces;
-using TelegramBotBase.Sessions;
namespace TelegramBotBase.MessageLoops;
@@ -17,7 +16,7 @@ public class MinimalMessageLoop : IMessageLoopFactory
private readonly EventHandlerList _events = new();
- public async Task MessageLoop(BotBase bot, DeviceSession session, UpdateResult ur, MessageResult mr)
+ public async Task MessageLoop(BotBase bot, IDeviceSession session, UpdateResult ur, MessageResult mr)
{
var update = ur.RawData;
diff --git a/TelegramBotBase/SessionManager.cs b/TelegramBotBase/SessionManager.cs
index 7e9d257..5e6975e 100644
--- a/TelegramBotBase/SessionManager.cs
+++ b/TelegramBotBase/SessionManager.cs
@@ -21,7 +21,7 @@ public class SessionManager
public SessionManager(BotBase botBase)
{
BotBase = botBase;
- SessionList = new Dictionary();
+ SessionList = new Dictionary();
}
///
@@ -32,7 +32,7 @@ public SessionManager(BotBase botBase)
///
/// A list of all active sessions.
///
- public Dictionary SessionList { get; set; }
+ public Dictionary SessionList { get; set; }
///
@@ -45,7 +45,7 @@ public SessionManager(BotBase botBase)
///
///
///
- public DeviceSession GetSession(long deviceId)
+ public IDeviceSession GetSession(long deviceId)
{
var ds = SessionList.FirstOrDefault(a => a.Key == deviceId).Value ?? null;
return ds;
@@ -57,7 +57,7 @@ public DeviceSession GetSession(long deviceId)
///
///
///
- public async Task StartSession(long deviceId)
+ public async Task StartSession(long deviceId)
{
var start = BotBase.StartFormFactory.CreateForm();
@@ -91,7 +91,7 @@ public void EndSession(long deviceId)
/// Returns all active User Sessions.
///
///
- public List GetUserSessions()
+ public List GetUserSessions()
{
return SessionList.Where(a => a.Key > 0).Select(a => a.Value).ToList();
}
@@ -100,7 +100,7 @@ public List GetUserSessions()
/// Returns all active Group Sessions.
///
///
- public List GetGroupSessions()
+ public List GetGroupSessions()
{
return SessionList.Where(a => a.Key < 0).Select(a => a.Value).ToList();
}
diff --git a/TelegramBotBase/Sessions/DeviceSession.cs b/TelegramBotBase/Sessions/DeviceSession.cs
index f2b49d2..05e9728 100644
--- a/TelegramBotBase/Sessions/DeviceSession.cs
+++ b/TelegramBotBase/Sessions/DeviceSession.cs
@@ -312,7 +312,7 @@ public async Task Send(string text, InlineKeyboardMarkup markup, int re
///
///
///
- public async Task Send(string text, ReplyMarkupBase markup, int replyTo = 0,
+ public async Task Send(string text, IReplyMarkup markup, int replyTo = 0,
bool disableNotification = false, ParseMode parseMode = ParseMode.Markdown,
bool markdownV2AutoEscape = true)
{
diff --git a/TelegramBotBase/States/Converter/DictionaryTypeConverter.cs b/TelegramBotBase/States/Converter/DictionaryTypeConverter.cs
new file mode 100644
index 0000000..c23cd8b
--- /dev/null
+++ b/TelegramBotBase/States/Converter/DictionaryTypeConverter.cs
@@ -0,0 +1,155 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+
+namespace TelegramBotBase.States.Converter
+{
+ public class DictionaryObjectJsonConverter : JsonConverter>
+ {
+ public override Dictionary Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+ {
+ var dictionary = new Dictionary();
+ var jsonDocument = JsonDocument.ParseValue(ref reader);
+
+ foreach (var element in jsonDocument.RootElement.EnumerateObject())
+ {
+ switch (element.Value.ValueKind)
+ {
+ case JsonValueKind.String:
+ dictionary[element.Name] = element.Value.GetString();
+ break;
+ case JsonValueKind.Number:
+
+ if (element.Value.TryGetInt32(out var number))
+ {
+ dictionary[element.Name] = number;
+ continue;
+ }
+
+ if (element.Value.TryGetInt64(out long l))
+ dictionary[element.Name] = l;
+ else
+ dictionary[element.Name] = element.Value.GetDouble();
+ break;
+ case JsonValueKind.True:
+ case JsonValueKind.False:
+ dictionary[element.Name] = element.Value.GetBoolean();
+ break;
+ case JsonValueKind.Object:
+ dictionary[element.Name] = JsonSerializer.Deserialize>(element.Value.GetRawText(), options);
+ break;
+ case JsonValueKind.Array:
+
+ dictionary[element.Name] = HandleArray(element.Value);
+
+ break;
+ default:
+ dictionary[element.Name] = element.Value.GetRawText();
+ break;
+ }
+ }
+
+ return dictionary;
+ }
+
+
+
+ private object HandleArray(JsonElement jsonArray)
+ {
+ // Hier wird geprüft, ob alle Elemente einer bestimmten Art angehören (z. B. int, string)
+ if (jsonArray.GetArrayLength() > 0)
+ {
+ var firstElement = jsonArray[0];
+ switch (firstElement.ValueKind)
+ {
+ case JsonValueKind.Number:
+ // Prüfen, ob alle Elemente ganze Zahlen sind
+ var isIntArray = true;
+ var isLongArray = false;
+
+ foreach (var element in jsonArray.EnumerateArray())
+ {
+ if (!element.TryGetInt32(out _))
+ {
+ isIntArray = false;
+ isLongArray = true;
+ if (!element.TryGetInt64(out _))
+ {
+ isLongArray = false;
+ break;
+ }
+ }
+ }
+ if (isIntArray)
+ {
+ var list = new List();
+ foreach (var element in jsonArray.EnumerateArray())
+ {
+ list.Add(element.GetInt32());
+ }
+ return list;
+ }
+ else if (isLongArray)
+ {
+ var list = new List();
+ foreach (var element in jsonArray.EnumerateArray())
+ {
+ list.Add(element.GetInt64());
+ }
+ return list;
+ }
+ else
+ {
+ var list = new List();
+ foreach (var element in jsonArray.EnumerateArray())
+ {
+ list.Add(element.GetDouble());
+ }
+ return list;
+ }
+ case JsonValueKind.String:
+ var stringList = new List();
+ foreach (var element in jsonArray.EnumerateArray())
+ {
+ stringList.Add(element.GetString());
+ }
+ return stringList;
+ case JsonValueKind.True:
+ case JsonValueKind.False:
+ var boolList = new List();
+ foreach (var element in jsonArray.EnumerateArray())
+ {
+ boolList.Add(element.GetBoolean());
+ }
+ return boolList;
+ default:
+ // Fallback: Liste von Objekten (z. B. wenn es sich um komplexe Objekte handelt)
+ var objectList = new List