Module telegram-bot-lua.methods.chat
chat API methods.
Functions
| api.approve_chat_join_request(chat_id, user_id) | approve a chat join request. |
| api.create_chat_invite_link(chat_id, opts) | create an additional invite link for a chat. |
| api.decline_chat_join_request(chat_id, user_id) | decline a chat join request. |
| api.delete_chat_photo(chat_id) | delete a chat photo. |
| api.delete_chat_sticker_set(chat_id) | delete a group sticker set from a supergroup. |
| api.edit_chat_invite_link(chat_id, invite_link, opts) | edit a non-primary invite link created by the bot. |
| api.export_chat_invite_link(chat_id) | generate a new primary invite link for a chat; any previously generated primary link is revoked. |
| api.get_chat(chat_id) | get up-to-date information about the chat. |
| api.get_chat_administrators(chat_id) | get a list of administrators in a chat. |
| api.get_chat_member(chat_id, user_id) | get information about a member of a chat. |
| api.get_chat_member_count(chat_id) | get the number of members in a chat. |
| api.get_user_chat_boosts(chat_id, user_id) | get the list of boosts added to a chat by a user. |
| api.leave_chat(chat_id) | leave a group, supergroup or channel. |
| api.pin_chat_message(chat_id, message_id, opts) | pin a message in a group, supergroup or channel. |
| api.revoke_chat_invite_link(chat_id, invite_link) | revoke an invite link created by the bot. |
| api.set_chat_description(chat_id, description) | change the description of a group, supergroup or channel. |
| api.set_chat_permissions(chat_id, permissions, opts) | set default chat permissions for all members. |
| api.set_chat_photo(chat_id, photo) | set a new profile photo for the chat. |
| api.set_chat_sticker_set(chat_id, sticker_set_name) | set a new group sticker set for a supergroup. |
| api.set_chat_title(chat_id, title) | change the title of a chat. |
| api.unpin_all_chat_messages(chat_id) | clear the list of pinned messages in a chat. |
| api.unpin_chat_message(chat_id, opts) | remove a message from the list of pinned messages in a chat. |
Functions
- api.approve_chat_join_request(chat_id, user_id)
-
approve a chat join request.
Parameters:
- chat_id number|string unique identifier for the target chat or username of the target channel
- user_id number unique identifier of the target user
Returns:
-
table,number the response object and HTTP status
- api.create_chat_invite_link(chat_id, opts)
-
create an additional invite link for a chat.
Parameters:
- chat_id number|string unique identifier for the target chat or username of the target channel
- opts table optional parameters
- name string invite link name (max 32 characters)
- expire_date number point in time (unix timestamp) when the link will expire
- member_limit number maximum number of users that can be members simultaneously
- creates_join_request boolean true if users joining via the link need to be approved
Returns:
-
table,number the response object and HTTP status
- api.decline_chat_join_request(chat_id, user_id)
-
decline a chat join request.
Parameters:
- chat_id number|string unique identifier for the target chat or username of the target channel
- user_id number unique identifier of the target user
Returns:
-
table,number the response object and HTTP status
- api.delete_chat_photo(chat_id)
-
delete a chat photo.
Parameters:
- chat_id number|string unique identifier for the target chat or username of the target channel
Returns:
-
table,number the response object and HTTP status
- api.delete_chat_sticker_set(chat_id)
-
delete a group sticker set from a supergroup.
Parameters:
- chat_id number|string unique identifier for the target chat or username of the target supergroup
Returns:
-
table,number the response object and HTTP status
- api.edit_chat_invite_link(chat_id, invite_link, opts)
-
edit a non-primary invite link created by the bot.
Parameters:
- chat_id number|string unique identifier for the target chat or username of the target channel
- invite_link string the invite link to edit
- opts table optional parameters
- name string invite link name (max 32 characters)
- expire_date number point in time (unix timestamp) when the link will expire
- member_limit number maximum number of users that can be members simultaneously
- creates_join_request boolean true if users joining via the link need to be approved
Returns:
-
table,number the response object and HTTP status
- api.export_chat_invite_link(chat_id)
-
generate a new primary invite link for a chat; any previously generated primary link is revoked.
Parameters:
- chat_id number|string unique identifier for the target chat or username of the target channel
Returns:
-
table,number the response object and HTTP status
- api.get_chat(chat_id)
-
get up-to-date information about the chat.
Parameters:
- chat_id number|string unique identifier for the target chat or username of the target supergroup/channel
Returns:
-
table,number the response object and HTTP status
- api.get_chat_administrators(chat_id)
-
get a list of administrators in a chat.
Parameters:
- chat_id number|string unique identifier for the target chat or username of the target supergroup/channel
Returns:
-
table,number the response object and HTTP status
- api.get_chat_member(chat_id, user_id)
-
get information about a member of a chat.
Parameters:
- chat_id number|string unique identifier for the target chat or username of the target supergroup/channel
- user_id number unique identifier of the target user
Returns:
-
table,number the response object and HTTP status
- api.get_chat_member_count(chat_id)
-
get the number of members in a chat.
Parameters:
- chat_id number|string unique identifier for the target chat or username of the target supergroup/channel
Returns:
-
table,number the response object and HTTP status
- api.get_user_chat_boosts(chat_id, user_id)
-
get the list of boosts added to a chat by a user.
Parameters:
- chat_id number|string unique identifier for the target chat or username of the target channel
- user_id number unique identifier of the target user
Returns:
-
table,number the response object and HTTP status
- api.leave_chat(chat_id)
-
leave a group, supergroup or channel.
Parameters:
- chat_id number|string unique identifier for the target chat or username of the target supergroup/channel
Returns:
-
table,number the response object and HTTP status
- api.pin_chat_message(chat_id, message_id, opts)
-
pin a message in a group, supergroup or channel.
Parameters:
- chat_id number|string unique identifier for the target chat or username of the target channel
- message_id number identifier of a message to pin
- opts table optional parameters
- disable_notification boolean pass true to pin silently
- business_connection_id string unique identifier of the business connection
Returns:
-
table,number the response object and HTTP status
- api.revoke_chat_invite_link(chat_id, invite_link)
-
revoke an invite link created by the bot.
Parameters:
- chat_id number|string unique identifier for the target chat or username of the target channel
- invite_link string the invite link to revoke
Returns:
-
table,number the response object and HTTP status
- api.set_chat_description(chat_id, description)
-
change the description of a group, supergroup or channel. truncated to 255 characters.
Parameters:
- chat_id number|string unique identifier for the target chat or username of the target channel
- description string new chat description (max 255 characters)
Returns:
-
table,number the response object and HTTP status
- api.set_chat_permissions(chat_id, permissions, opts)
-
set default chat permissions for all members.
Parameters:
- chat_id number|string unique identifier for the target chat or username of the target supergroup
- permissions table|string a JSON-serialized object for new default chat permissions
- opts table optional parameters
- use_independent_chat_permissions boolean pass true if chat permissions are set independently
Returns:
-
table,number the response object and HTTP status
- api.set_chat_photo(chat_id, photo)
-
set a new profile photo for the chat.
Parameters:
- chat_id number|string unique identifier for the target chat or username of the target channel
- photo string new chat photo (file upload)
Returns:
-
table,number the response object and HTTP status
- api.set_chat_sticker_set(chat_id, sticker_set_name)
-
set a new group sticker set for a supergroup.
Parameters:
- chat_id number|string unique identifier for the target chat or username of the target supergroup
- sticker_set_name string name of the sticker set
Returns:
-
table,number the response object and HTTP status
- api.set_chat_title(chat_id, title)
-
change the title of a chat. truncated to 128 characters.
Parameters:
- chat_id number|string unique identifier for the target chat or username of the target channel
- title string new chat title (max 128 characters)
Returns:
-
table,number the response object and HTTP status
- api.unpin_all_chat_messages(chat_id)
-
clear the list of pinned messages in a chat.
Parameters:
- chat_id number|string unique identifier for the target chat or username of the target channel
Returns:
-
table,number the response object and HTTP status
- api.unpin_chat_message(chat_id, opts)
-
remove a message from the list of pinned messages in a chat.
Parameters:
- chat_id number|string unique identifier for the target chat or username of the target channel
- opts table optional parameters
- message_id number identifier of the message to unpin
- business_connection_id string unique identifier of the business connection
Returns:
-
table,number the response object and HTTP status