Skip to content

Commit f71dc8a

Browse files
authored
Merge pull request #898 from noplanman/897-fix_sendToActiveChats
Fix sendToActiveChats
2 parents 9a59c01 + 88ed0f3 commit f71dc8a

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
99
### Deprecated
1010
### Removed
1111
### Fixed
12+
- `sendToActiveChats` now works correctly for any valid Request action.
1213
### Security
1314

1415
## [0.54.0] - 2018-07-21

src/Request.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -603,17 +603,15 @@ public static function sendToActiveChats(
603603
array $data,
604604
array $select_chats_params
605605
) {
606-
if (!method_exists(Request::class, $callback_function)) {
607-
throw new TelegramException('Method "' . $callback_function . '" not found in class Request.');
608-
}
606+
self::ensureValidAction($callback_function);
609607

610608
$chats = DB::selectChats($select_chats_params);
611609

612610
$results = [];
613611
if (is_array($chats)) {
614612
foreach ($chats as $row) {
615613
$data['chat_id'] = $row['chat_id'];
616-
$results[] = call_user_func(Request::class . '::' . $callback_function, $data);
614+
$results[] = self::send($callback_function, $data);
617615
}
618616
}
619617

0 commit comments

Comments
 (0)