You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| json_payload | boolean | true | Whether or not print json payload |
17
+
| log_updates | integer | false | Chat id where raw json updates will be sent (set to false to disable) |
18
+
| debug | integer | false | Chat id where debug logs will be sent if an api error occurs (set to false to disable) |
19
+
| disable_ip_check | boolean | false | Whether or not disable telegram ip check (could be useful in case of reverse proxy, such as ngrok) |
20
+
| disable_webhook | boolean | false | Whether or not disable update receiving |
21
+
| parse_mode | string | no | Default `parse_mode` for methods that require it |
22
+
| disable_web_page_preview | string | no | Default `disable_web_page_preview` for methods that require it |
23
+
| disable_notification | string | no | Default `disable_notification` for methods that require it |
24
+
| exceptions | bool | true | Whether or not throw \skrtdev\Telegram\Exception(s) when API Errors occurs |
25
+
| database | array | no |[Database](database.md) connection info |
24
26
25
27
### JSON Payload
26
28
27
29
JSON Payload is a different way to make API Calls.
28
30
In Webhooks, you can print a JSON-Encoded request directly in the webhook page, that will be processed by Telegram afterwards, without effectively making an API Call.
29
-
> Only One API Call can use JSON Payload in the same execution contest
31
+
> Only One API Call can use JSON Payload simultaneously
30
32
31
33
#### Pro:
32
34
* Since no HTTP Request is involved, using Payload speeds up the bot.
Copy file name to clipboardExpand all lines: docs/start.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ $message = $update->message;
20
20
$chat = $message->chat;
21
21
$user = $message->from;
22
22
23
-
$update->message->forward([], true); // forward() with no parameters will forward the Message back to the sender
23
+
$message->forward([], true); // forward() with no parameters will forward the Message back to the sender
24
24
```
25
25
26
26
Using `"json_payload" => true` and `true` in forward method, the api call will be print as payload, making the bot faster. Only one Api Call can use json payload
Copy file name to clipboardExpand all lines: examples/EchoBot.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,9 @@
6
6
require "../PHPEasyGit/autoload.php";
7
7
*/
8
8
9
-
$Bot = newNovaGram\Bot("YOUR_TOKEN", [
9
+
useskrtdev\NovaGram\Bot;
10
+
11
+
$Bot = newBot("YOUR_TOKEN", [
10
12
"debug" => YOURCHATID, // chat id where debug will be sent when api errors occurs
11
13
"json_payload" => true, // allow use of json payload (without this, all the api calls will be made normally, even if they should be made as json payload)
Copy file name to clipboardExpand all lines: examples/EncoderBot.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,9 @@
6
6
require "../PHPEasyGit/autoload.php";
7
7
*/
8
8
9
-
$Bot = newNovaGram\Bot("YOUR_TOKEN", [
9
+
useskrtdev\NovaGram\Bot;
10
+
11
+
$Bot = newBot("YOUR_TOKEN", [
10
12
"debug" => YOURCHATID, // chat id where debug will be sent when api errors occurs
11
13
"json_payload" => true, // allow use of json payload (without this, all the api calls will be made normally, even if they should be made as json payload)
12
14
"parse_mode" => "HTML"// will set parse_mode automatically in methods that require it if not providedå
0 commit comments