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
If you choose to / or are obliged to use the `getUpdates` method without a database, you can replace the `$telegram->enableMySql(...);` line above with:
340
-
```php
341
-
$telegram->useGetUpdatesWithoutDatabase();
342
-
```
343
-
344
323
## Filter Update
345
324
346
325
:exclamation: Note that by default, Telegram will send any new update types that may be added in the future. This may cause commands that don't take this into account to break!
@@ -463,59 +442,14 @@ Get the file path and download it. (see *[WhoamiCommand.php]* for a full example
463
442
464
443
#### Send message to all active chats
465
444
466
-
To do this you have to enable the MySQL connection.
467
-
Here's an example of use (check [`DB::selectChats()`][DB::selectChats] for parameter usage):
468
-
469
-
```php
470
-
$results = Request::sendToActiveChats(
471
-
'sendMessage', // Callback function to execute (see Request.php methods)
472
-
['text' => 'Hey! Check out the new features!!'], // Param to evaluate the request
473
-
[
474
-
'groups' => true,
475
-
'supergroups' => true,
476
-
'channels' => false,
477
-
'users' => true,
478
-
]
479
-
);
480
-
```
481
-
482
-
You can also broadcast a message to users, from the private chat with your bot. Take a look at the [admin commands](#admin-commands) below.
445
+
This feature is currently disabled due to the removal of database functionality.
483
446
484
447
## Utils
485
448
486
449
### MySQL storage (Recommended)
487
450
488
-
If you want to save messages/users/chats for further usage in commands, create a new database (`utf8mb4_unicode_520_ci`), import *[structure.sql]* and enable MySQL support BEFORE `handle()` method:
451
+
Database storage functionality has been removed from this library.
489
452
490
-
```php
491
-
$mysql_credentials = [
492
-
'host' => 'localhost',
493
-
'port' => 3306, // optional
494
-
'user' => 'dbuser',
495
-
'password' => 'dbpass',
496
-
'database' => 'dbname',
497
-
];
498
-
499
-
$telegram->enableMySql($mysql_credentials);
500
-
```
501
-
502
-
You can set a custom prefix to all the tables while you are enabling MySQL:
$data['text'] = '*Database cleanup failed!* _(check your error logs)_';
425
-
426
-
// rollback changes on exception
427
-
// useful if you want to track down error you can't replicate it when some of the data is already deleted
428
-
$pdo->rollBack();
429
-
430
-
TelegramLog::error($e->getMessage());
431
-
}
432
-
433
-
return Request::sendMessage($data);
367
+
return$this->replyToChat('This command is not available because the database feature has been removed.' . PHP_EOL . 'Type /debug to see all available information.');
0 commit comments