Luagram is a Lua library for creating chatbots for Telegram.
It has been designed from the ground up to be intuitive and fast. When using Luagram, challenging tasks become easy, as it not only provides basic features but also offers capabilities not found in other libraries.
Luagram Features
- Composes: A powerful API for sending stylized messages, media, and even transactions to users.
- Sessions: Continue and pause conversations with users intuitively.
- Commands: Define functions for predefined commands.
- Events: Create events that respond to updates and compose buttons.
- Translations: Send messages to your users in their language.
- Addons: It’s straightforward to add or create addons for Luagram.
Basic Usage
Below is an example of Hello world. This code is similar to what you find in other Telegram bot libraries. Luagram can do much more than that!
local Luagram = require("Luagram")
local bot = Luagram.new("...your token from Botfather...")
bot:on_message(function(message)
bot:send_message({
chat_id = message.chat.id,
text = "Hello World!"
})
end)
At the bottom of this documentation, you can change the programming language between Lua or Moonscript (a Lua dialect) and also the programming style. The chain style closely resembles jQuery. Choose the option that suits you best. Your selection will be remembered on this device every time you access this documentation. All examples in this documentation are displayed in the language/style you have chosen. You can change it at any time.
License
Luagram is distributed by an MIT license.
Contributing
If you wish to contribute to the project, you can suggest pull requests in our GitHub repository. Code and documentation improvements and fixes are always welcome!