Skip to content

Commit 1c4e024

Browse files
committed
added only_if_banned global paramater
1 parent 9b0ff18 commit 1c4e024

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- `group_handlers`: Whether to execute all the handlers of an update in the same process (`true`), or fork a process for each handler (`false`)
88
- `wait_handlers`: Whether to wait for handlers to finish when closing script
99
- `threshold`: Amount of max seconds the script will sleep instead of throwing a `TooManyRequestsException`. Defaults to 10 when using `getUpdates`
10+
- `only_if_banned`: Default value for `only_if_banned` parameter in `unbanChatMember` method
1011
- Conversations **full getters**
1112
- `getConversationsByChat` (`User|Chat::getConversations()`)
1213
- `getConversationsByValue`

docs/construct.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ $settings is an array which contains some NovaGram configurations.
3535
| disable_web_page_preview | bool | null | Default `disable_web_page_preview` for methods that require it |
3636
| disable_notification | bool | null | Default `disable_notification` for methods that require it |
3737
| allow_sending_without_reply | bool | null | Default `allow_sending_without_reply` for methods that require it |
38+
| only_if_banned | bool | null | Default `only_if_banned` for unbanChatMember method |
3839

3940
### Mode
4041

src/NovaGram/Bot.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,7 @@ private function methodHasParamater(string $method, string $parameter){
321321
}
322322

323323
private function normalizeRequest(string $method, array $data){
324-
$params = ['parse_mode', 'disable_web_page_preview', 'disable_notification', 'allow_sending_without_reply'];
325-
foreach ($params as $param) {
324+
foreach (array_keys($this->json['require_params']) as $param) {
326325
if($this->methodHasParamater($method, $param) and isset($this->settings->$param)){
327326
$data[$param] ??= $this->settings->$param;
328327
}

src/NovaGram/json.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@
216216
"sendSticker",
217217
"sendInvoice",
218218
"sendGame"
219-
]
219+
],
220+
"only_if_banned": ["unbanChatMember"]
220221
},
221222
"require_json_encode":[
222223
"allowed_updates",

0 commit comments

Comments
 (0)