-
-
Notifications
You must be signed in to change notification settings - Fork 955
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: Call to undefined method Longman\TelegramBot\Telegram::setWebHook() #153
Comments
Some context or something would be very helpful here. |
I just try to setWebHook and used set.php from example |
That's strange... To maybe help us, could you enter the following line directly after the die(var_dump($telegram)); |
object(Longman\TelegramBot\Telegram)#2 (6) { ["api_key":protected]=> string(45) "_MY_API_KEY_*" ["input":protected]=> NULL ["commands_dir":protected]=> array(0) { } ["update":protected]=> NULL ["log_requests":protected]=> NULL ["log_path":protected]=> NULL } |
Right, so you have a valid object. |
Seems impossible also to me! php version system ? |
PHP 5.6.19 |
@igimastudio Have you managed to find out what the problem is/was? Are you maybe including the vendor autoloader multiple times?! |
@igimastudio If this is still an issue for you, feel free to reopen. |
This happened to me as well. Object created, but found the error:
Here is the getUpdateCLI.php code: #!/usr/bin/env php
<?php
require __DIR__ . '/vendor/autoload.php';
$API_KEY = 'redacted:redacted';
$BOT_NAME = 'redactedBot';
$mysql_credentials = [
'host' => 'localhost',
'user' => 'root',
'password' => 'redacted',
'database' => 'redacted',
];
try {
// Create Telegram API object
$telegram = new Longman\TelegramBot\Telegram($API_KEY, $BOT_NAME);
// Enable MySQL
$telegram->enableMySQL($mysql_credentials);
// Handle telegram getUpdate request
$telegram->handleGetUpdates();
} catch (Longman\TelegramBot\Exception\TelegramException $e) {
// log telegram errors
echo $e;
} |
Fixed. I created the composer.json manually (following README.md) and for some reason it didn't work. I then removed all the files, and use the |
@lawrencegs Do you know what was different in the automatically generated composer.json file? I still can't understand how this happens. |
What about put \ in front of longman?
|
I have same problem. |
No description provided.
The text was updated successfully, but these errors were encountered: