Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error: Uncaught Telegram\Bot\Exceptions\TelegramOtherException: Unauthorized #940

Closed
duquesimba opened this issue Apr 18, 2022 · 1 comment

Comments

@duquesimba
Copy link

duquesimba commented Apr 18, 2022

Fatal error: Uncaught Telegram\Bot\Exceptions\TelegramOtherException: Unauthorized in /home/xxxxxxx/public_html/vendor/irazasyed/telegram-bot-sdk/src/Exceptions/TelegramResponseException.php:58 Stack trace: #0 /home/xxxxxxxxx/public_html/vendor/irazasyed/telegram-bot-sdk/src/TelegramResponse.php(174): Telegram\Bot\Exceptions\TelegramResponseException::create(Object(Telegram\Bot\TelegramResponse)) #1 /home/xxxxxxxxxxxxxxxxx/public_html/vendor/irazasyed/telegram-bot-sdk/src/TelegramResponse.php(204): Telegram\Bot\TelegramResponse->makeException() #2 /home/xxxxxxxxxxxxxx/public_html/vendor/irazasyed/telegram-bot-sdk/src/TelegramResponse.php(65): Telegram\Bot\TelegramResponse->decodeBody() #3 /home/xxxxxxxxxxxxxx/public_html/vendor/irazasyed/telegram-bot-sdk/src/TelegramClient.php(138): Telegram\Bot\TelegramResponse->__construct(Object(Telegram\Bot\TelegramRequest), Object(GuzzleHttp\Psr7\Response)) #4 /home/xxxxxxxxxxx/public_html/vendor/irazasyed/telegram-bot-sdk/src/TelegramClient.php(119): Telegram\Bot\TelegramClient->get in /home/xxxxxxxxxxxxxxxxx/public_html/vendor/irazasyed/telegram-bot-sdk/src/Exceptions/TelegramResponseException.php on line 58

`<?php
require '../vendor/autoload.php';
use Telegram\Bot\Api;

$telegram = new Api('xxxxxxxxxxx');

$response = $telegram->getMe();

$botId = $response->getId();
$firstName = $response->getFirstName();
$username = $response->getUsername();

echo "Bot id: ". $botId;

?>`
@duquesimba duquesimba changed the title Fatal error: Uncaught GuzzleHttp\Exception\ClientException Fatal error: Uncaught Telegram\Bot\Exceptions\TelegramOtherException: Unauthorized Apr 18, 2022
@Arsham-rmz
Copy link

i think your token isn't correct :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants