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

Telegram::getBots() returning empty array #1155

Open
ihaswn opened this issue Feb 10, 2025 · 0 comments
Open

Telegram::getBots() returning empty array #1155

ihaswn opened this issue Feb 10, 2025 · 0 comments
Labels

Comments

@ihaswn
Copy link

ihaswn commented Feb 10, 2025

PHP version

8.0

irazasyed/telegram-bot-sdk version

v3.14.0

Laravel version (if any)

11

Code To Reproduce the bug

hi, i want to get a bot name from token, i made this method in TelegramService Class:

public static function getBotNameByToken($token)
    {
        $bot_name = null;
        $bots = Telegram::getBots();

        foreach (array_keys($bots) as $name) {
            if (Telegram::bot($name)->getAccessToken() == $token) {
                $bot_name = $name;
                break;
            }
        }

        return $bot_name;
    }

the problem is Telegram::getBots() is returning an empty array, it used to work but suddenly its just returning empty, i registered a few bots in the telegram.php config file, and when i do Telegram::bot('bot_name') its working, but they will not get included in getBots method anymore, why is that??

Error stacktrace (if any)

No response

@ihaswn ihaswn added the bug label Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant