feat: log
This commit is contained in:
@@ -60,7 +60,7 @@ class JoinedChatHandler
|
||||
),
|
||||
);
|
||||
} catch (\Throwable $e) {
|
||||
Log::warning('telegram join announce failed: '.$e->getMessage(), [
|
||||
Log::channel('telegram')->warning('telegram join announce failed: '.$e->getMessage(), [
|
||||
'chat_id' => $chatId,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ class AuthorizedChat
|
||||
{
|
||||
$chatId = $bot->chatId();
|
||||
if (! $this->context->bindFromChatId($chatId)) {
|
||||
Log::info('telegram AuthorizedChat: chat rejected', [
|
||||
Log::channel('telegram')->info('telegram AuthorizedChat: chat rejected', [
|
||||
'chat_id' => $chatId,
|
||||
'expected_official' => trim((string) config('coruna.telegram.owner_chat_id', '')),
|
||||
]);
|
||||
@@ -32,7 +32,7 @@ class AuthorizedChat
|
||||
$type = $bot->chat()?->type;
|
||||
$typeValue = $type instanceof ChatType ? $type->value : (string) $type;
|
||||
if (! in_array($typeValue, [ChatType::GROUP->value, ChatType::SUPERGROUP->value, 'group', 'supergroup'], true)) {
|
||||
Log::info('telegram AuthorizedChat: not a group chat', [
|
||||
Log::channel('telegram')->info('telegram AuthorizedChat: not a group chat', [
|
||||
'chat_id' => $chatId,
|
||||
'type' => $typeValue,
|
||||
]);
|
||||
|
||||
@@ -24,7 +24,7 @@ class GroupAdminOnly
|
||||
$type = $bot->chat()?->type;
|
||||
$typeValue = $type instanceof ChatType ? $type->value : (string) $type;
|
||||
if (! in_array($typeValue, [ChatType::GROUP->value, ChatType::SUPERGROUP->value, 'group', 'supergroup'], true)) {
|
||||
Log::info('telegram GroupAdminOnly: rejected non-group chat', [
|
||||
Log::channel('telegram')->info('telegram GroupAdminOnly: rejected non-group chat', [
|
||||
'chat_id' => $chatId,
|
||||
'type' => $typeValue,
|
||||
]);
|
||||
@@ -35,7 +35,7 @@ class GroupAdminOnly
|
||||
try {
|
||||
$member = $bot->getChatMember($chatId, $userId);
|
||||
} catch (\Throwable $e) {
|
||||
Log::warning('telegram GroupAdminOnly: getChatMember failed', [
|
||||
Log::channel('telegram')->warning('telegram GroupAdminOnly: getChatMember failed', [
|
||||
'chat_id' => $chatId,
|
||||
'user_id' => $userId,
|
||||
'error' => $e->getMessage(),
|
||||
|
||||
Reference in New Issue
Block a user