summaryrefslogtreecommitdiff
path: root/include/tgbot/Api.h
diff options
context:
space:
mode:
authorllnulldisk <48621230+llnulldisk@users.noreply.github.com>2022-09-04 20:59:46 +0200
committerllnulldisk <48621230+llnulldisk@users.noreply.github.com>2022-09-04 20:59:46 +0200
commit5a72b4b1fc89d9b6033f929d9bf4f6e30d7f9698 (patch)
tree33fba0566f2bb1f378ca2d3de57fe63170312cca /include/tgbot/Api.h
parent5492d26d21d09dc9cc3551f32a8eab7a2e783e3c (diff)
Update to API 5.4
Diffstat (limited to 'include/tgbot/Api.h')
-rw-r--r--include/tgbot/Api.h38
1 files changed, 35 insertions, 3 deletions
diff --git a/include/tgbot/Api.h b/include/tgbot/Api.h
index 51717db..428c8b2 100644
--- a/include/tgbot/Api.h
+++ b/include/tgbot/Api.h
@@ -612,7 +612,7 @@ public:
* We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.
*
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- * @param action Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, find_location for location data, record_video_note or upload_video_note for video notes.
+ * @param action Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video notes.
*
* @return True on success.
*/
@@ -763,12 +763,16 @@ public:
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
* @param expireDate Optional. Point in time (Unix timestamp) when the link will expire
* @param memberLimit Optional. Maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
+ * @param name Optional. Invite link name; 0-32 characters
+ * @param createsJoinRequest Optional. True, if users joining the chat via the link need to be approved by chat administrators. If True, memberLimit can't be specified
*
* @return the new invite link as ChatInviteLink object.
*/
ChatInviteLink::Ptr createChatInviteLink(std::int64_t chatId,
std::int32_t expireDate = 0,
- std::int32_t memberLimit = 0) const;
+ std::int32_t memberLimit = 0,
+ const std::string& name = "",
+ bool createsJoinRequest = false) const;
/**
* @brief Use this method to edit a non-primary invite link created by the bot.
@@ -778,13 +782,17 @@ public:
* @param inviteLink The invite link to edit
* @param expireDate Optional. Point in time (Unix timestamp) when the link will expire
* @param memberLimit Optional. Maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
+ * @param name Optional. Invite link name; 0-32 characters
+ * @param createsJoinRequest Optional. True, if users joining the chat via the link need to be approved by chat administrators. If True, memberLimit can't be specified
*
* @return the edited invite link as a ChatInviteLink object.
*/
ChatInviteLink::Ptr editChatInviteLink(std::int64_t chatId,
std::string inviteLink,
std::int32_t expireDate = 0,
- std::int32_t memberLimit = 0) const;
+ std::int32_t memberLimit = 0,
+ const std::string& name = "",
+ bool createsJoinRequest = false) const;
/**
* @brief Use this method to revoke an invite link created by the bot.
@@ -800,6 +808,30 @@ public:
std::string inviteLink) const;
/**
+ * @brief 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 canInviteUsers administrator right.
+ *
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+ * @param userId Unique identifier of the target user
+ *
+ * @return True on success.
+ */
+ bool approveChatJoinRequest(std::int64_t chatId,
+ std::int64_t userId) const;
+
+ /**
+ * @brief 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 canInviteUsers administrator right.
+ *
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+ * @param userId Unique identifier of the target user
+ *
+ * @return True on success.
+ */
+ bool declineChatJoinRequest(std::int64_t chatId,
+ std::int64_t userId) const;
+
+ /**
* @brief Use this method to set a new profile photo for the chat.
*
* Photos can't be changed for private chats.