Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.įile to send. Use this function to send general files, using Telegram's sendDocument method. Pass a file_id 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. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.Īudio file to send. Use this function to send audio files, using Telegram's sendAudio method, if you want Telegram clients to display them in the music player. Photo caption (may also be used when resending photos by file_id), 0-200 characters Pass a file_id 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. Unique identifier for the target chat or username of the target channel (in the format or String Use this function to forward messages of any kind, using Telegram's forwardMessage method. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyĪdditional interface options. If the message is a reply, ID of the original message iOS users will not receive a notification, Android users will receive a notification with no sound. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message.ĭisables link previews for links in this message Unique identifier for the target chat or username of the target channel (in the format of the message to be sent Use this function to send text messages, using Telegram's sendMessage method. 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. If not specified the previous setting will be used. Specify an empty list to receive all updates regardless of type (default). For example, specify to only receive updates of these types. List the types of updates you want your bot to receive. Should be positive, short polling should be used for testing purposes only. Limits the number of updates to be retrieved. The negative offset can be specified to retrieve updates starting from -offset update from the end of the updates queue. An update is considered confirmed as soon as getUpdates is called with an offset higher than its update_id. By default, updates starting with the earliest unconfirmed update are returned. Must be greater by one than the highest among the identifiers of previously received updates. Identifier of the first update to be returned. That's it! Now you just need to include it in your bot's source code, with the configure function passing your bot auth token (the one you received from the BotFather), like this: To install this library, make sure you have Lua 5.3 and LuaRocks installed, then run luarocks install telegram-bot-lua. The licensing situation is currently under investigation, but don't panic, it'll get resolved cleanly. This library was written to complement the " mattata" project, allowing anybody to create their own Telegram bot with little coding knowledge needed (that is, except a basic knowledge of Lua and the inspiration provided by and this library). It is frequently updated and also includes extensive tools to reduce the amount of code needed to perform more elaborate and complex actions. This library includes functions that allow you to use any Telegram bot API method. A feature-filled Telegram bot API library written in Lua, created by Matt.
0 Comments
Leave a Reply. |