Module telegram-bot-lua.methods.gifts
gifts API methods.
Functions
| api.get_available_gifts() | get the list of gifts that can be sent by the bot. |
| api.get_user_gifts(user_id) | get the list of gifts received by a user. |
| api.send_gift(user_id, gift_id, opts) | send a gift to a user. |
Functions
- api.get_available_gifts()
-
get the list of gifts that can be sent by the bot.
Returns:
- table|false the available gifts object, or false on failure
- string|table the HTTP status or error details
- api.get_user_gifts(user_id)
-
get the list of gifts received by a user.
Parameters:
- user_id number unique identifier of the target user
Returns:
- table|false the user gifts object, or false on failure
- string|table the HTTP status or error details
- api.send_gift(user_id, gift_id, opts)
-
send a gift to a user.
Parameters:
- user_id number unique identifier of the target user
- gift_id string identifier of the gift to send
- opts table optional parameters (text, textparsemode, payforupgrade)
Returns:
- table|false true on success, or false on failure
- string|table the HTTP status or error details