1
1
# PHP Telegram Bot
2
- ======================
3
2
4
3
[ ![ Join the chat at
5
4
https://gitter.im/akalongman/php-telegram-bot ] ( https://badges.gitter.im/Join%20Chat.svg )] ( https://gitter.im/akalongman/php-telegram-bot?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge )
@@ -192,9 +191,8 @@ try {
192
191
// log telegram errors
193
192
echo $e;
194
193
}
195
-
196
-
197
194
```
195
+
198
196
give to the file the permission for execution:
199
197
```
200
198
chmod 775 getUpdateCLI.php
@@ -224,8 +222,7 @@ $telegram->enableMySQL($credentials, $BOT_NAME.'_');
224
222
All types implemented (except InputFile) according to Telegram API (2015 September 18).
225
223
226
224
### Commands
227
- The bot is able to recognise commands in chat with multiple bot(
228
- /command@mybot ).
225
+ The bot is able to recognise commands in chat with multiple bot(/command@mybot ).
229
226
It can execute command triggering a chat event. Here's the list:
230
227
231
228
- Group chat created (** GroupchatcreatedCommand.php** )
@@ -234,11 +231,13 @@ It can execute command triggering a chat event. Here's the list:
234
231
- New chat title (** NewchattitleCommand.php** )
235
232
- Left chat participant (** LeftchatparticipantCommand.php** )
236
233
237
- ** GenericCommand.php** lets you handle commands that don't exist or to
234
+ ** GenericCommand.php** let you handle commands that don't exist or to
238
235
use commands as a variable:
239
236
Favourite colour? ** /black, /red**
240
237
Favourite number? ** /1, /134**
241
238
239
+ ** GenericmessageCommand.php** let you handle any type of message.
240
+
242
241
Maybe you would like to develop your own commands. A good practice is
243
242
to store them outside * vendor/* . This can be done adding the method:
244
243
@@ -247,6 +246,8 @@ $COMMANDS_FOLDER = __DIR__.'/Commands/';
247
246
$telegram->addCommandsPath($COMMANDS_FOLDER);
248
247
```
249
248
249
+ Inside * CommandsExamples/* there are some sample that show how to use types.
250
+
250
251
### Admin Commands
251
252
Enabling this feature, the admin bot can perform some super user command like send message to all.
252
253
You can specify one or more admin with this option:
@@ -286,7 +287,7 @@ print_r($results);
286
287
### Logging
287
288
Thrown Exception are stored in TelegramException.log file.
288
289
289
- You can also log incoming messages on a text file, set this option with the methods:
290
+ Incoming update can be logged on a text file, set this option with the methods:
290
291
``` php
291
292
$telegram->setLogRequests(true);
292
293
$telegram->setLogPath($BOT_NAME.'.log');
0 commit comments