Skip to content

idea: Create a special Exception class for cases when bot is blocked by a user #1147

Open
@alies-dev

Description

@alies-dev

Why: it will simplify exception processing (by class, instead of description/message what is a bad practice)

Exception (this is everything what I have about this special case):

CleanShot 2024-11-17 at 20 00 03@2x

or text version:

 Telegram\Bot\Exceptions\TelegramResponseException 

  Forbidden: bot was blocked by the user

  at vendor/irazasyed/telegram-bot-sdk/src/Exceptions/TelegramResponseException.php:59
     55▕             $message = $data['description'] ?? 'Unknown error from API.';
     56▕         }
     57▕ 
     58▕         // Others
  ➜  59▕         return new self($response, new TelegramOtherException($message, $code));
     60▕     }

Error stacktrace (if any)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions