Skip to content

Commit 56309db

Browse files
add declineChatJoinRequest
1 parent 07aa508 commit 56309db

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/BotApi.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2140,6 +2140,24 @@ public function approveChatJoinRequest($chatId, $userId)
21402140
]);
21412141
}
21422142

2143+
/**
2144+
* 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 can_invite_users administrator right. Returns True on success.
2145+
*
2146+
* @param integer $chatId Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
2147+
* @param $userId
2148+
* @return bool
2149+
* @throws Exception
2150+
* @throws HttpException
2151+
* @throws InvalidJsonException
2152+
*/
2153+
public function declineChatJoinRequest($chatId, $userId)
2154+
{
2155+
return $this->call('declineChatJoinRequest', [
2156+
'chat_id' => $chatId,
2157+
'user_id' => $userId,
2158+
]);
2159+
}
2160+
21432161
/**
21442162
* Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights. Returns True on success.
21452163
*

0 commit comments

Comments
 (0)