@@ -22,9 +22,12 @@ API](https://telegram.org/blog/bot-revolution) allowing integrators of
22
22
all sorts to bring automated interactions to the mobile platform. This
23
23
Bot aims to provide a platform where one could simply write a plugin
24
24
and have interactions in a matter of minutes.
25
- - The Bot supports Reply Markup and handle commands in group chat with
26
- multiple bot.
27
- - The Bot can retrive update with webhook and by getUpdate methods.
25
+ The Bot can:
26
+ - retrive update with webhook and by getUpdate methods.
27
+ - supports all types and methods according to Telegram API (2015 October 8).
28
+ - handle commads in chat with other bots.
29
+
30
+ It is ready for the channels support.
28
31
29
32
30
33
## Instructions
@@ -115,7 +118,7 @@ composer require longman/telegram-bot
115
118
### Choose how to retrieve Telegram updates
116
119
The bot can handle updates with ** webhook** or ** getUpdate** method:
117
120
118
- | Method | Webhook | getUpdate |
121
+ | | Webhook | getUpdate |
119
122
| ---- | :----: | :----: |
120
123
| Description | Telegram send the update directy to your host | Yuo have to fetch Telegram updates |
121
124
| Host with https | Required | Not required |
@@ -148,7 +151,6 @@ try {
148
151
149
152
And open your * set.php* via browser.
150
153
151
-
152
154
After, create * hook.php* (or just edit * example-hook.php* ) and put:
153
155
``` php
154
156
<?php
@@ -168,6 +170,13 @@ try {
168
170
// echo $e;
169
171
}
170
172
```
173
+
174
+ ###Self Signed Certificate
175
+ To upload the certificate add the certificate path as param in * set.php* :
176
+ ``` php
177
+ $result = $telegram->setWebHook($url, $certificate_path);
178
+ ```
179
+
171
180
## getUpdate installation
172
181
You need the database Mysql active.
173
182
@@ -201,6 +210,18 @@ then run
201
210
```
202
211
./getUpdateCLI.php
203
212
```
213
+ ### Types
214
+ All types implemented according to Telegram API (2015 October 8).
215
+
216
+ ### Methods New!
217
+ All methods implemented according to Telegram API (2015 October 8).
218
+ TODO example to use methods
219
+
220
+ ``` php
221
+ $result = Request::sendPhoto($data,'image.jpg');
222
+ ```
223
+
224
+
204
225
## Utilis
205
226
### MySQL storage (Recomended)
206
227
If you want insert in database messages/users/chats for further usage
@@ -218,8 +239,6 @@ You can set a custom prefix to all the tables while you are enabling Mysql:
218
239
``` php
219
240
$telegram->enableMySQL($credentials, $BOT_NAME.'_');
220
241
```
221
- ### Types New!
222
- All types implemented (except InputFile) according to Telegram API (2015 September 18).
223
242
224
243
### Commands
225
244
The bot is able to recognise commands in chat with multiple bot(/command@mybot ).
@@ -268,6 +287,11 @@ example, google geocode/timezone api key for date command:
268
287
``` php
269
288
$telegram->setCommandConfig('date',
270
289
array('google_api_key'=>'your_google_api_key_here'));
290
+ ```
291
+ ### Upload and Download directory
292
+ You can overwrite the default Upload and download directory with:
293
+ ``` php
294
+
271
295
```
272
296
### Send message to all active chats
273
297
To do this you have to enable the Mysql connection.
@@ -276,15 +300,12 @@ Here's an example of use:
276
300
``` php
277
301
$results = $telegram->sendToActiveChats(
278
302
'sendMessage', //callback function to execute (see Request.php methods)
279
- array('text'=>'Hey! Checkout the new feature!!'), //Param to
280
- evaluate the request
303
+ array('text'=>'Hey! Checkout the new feature!!'), //Param to evaluate the request
281
304
true, //Send to chats (group chat)
282
305
true, //Send to users (single chat)
283
306
null, //'yyyy-mm-dd hh:mm:ss' date range from
284
307
null //'yyyy-mm-dd hh:mm:ss' date range to
285
308
);
286
-
287
- print_r($results);
288
309
```
289
310
290
311
### Logging
0 commit comments