Comments (9)
are you using 0.11?
from core.
Hello MBoretto,
I tried composer install require... then I got that problem
then I tried composer updatte .... problem solved :)
Thanks
from core.
yeah... seem like 0.1.1 has problem (composer install), when i tried 0.0.7 (clone from git), it works just fine.
I still receive: PHP Fatal error: Call to a member function isEnabled() on a non-object in after using 0.1.1
from core.
Issue is not related to nginx and still persists in 0.12
from core.
confirmed... I tried with apache, still have this problem
On Aug 8, 2015 11:10 PM, "Doranku" [email protected] wrote:
Issue is not related to nginx and still persists in 0.12
—
Reply to this email directly or view it on GitHub
#19 (comment)
.
from core.
The problem there is a non object in the getCommandsLists ('leftchatparticipant' => false)
To prevent this from having a working bot, the symptom can be avoided with following patch.
--- a/src/Commands/HelpCommand.php
+++ b/src/Commands/HelpCommand.php
@@ -37,6 +37,10 @@ class HelpCommand extends Command
$msg = 'GeoBot v. ' . $this->telegram->getVersion() . "\n\n";
$msg .= 'Commands List:' . "\n";
foreach ($commands as $command) {
+ if(!is_object($command))
+ {
+ continue;
+ }
if (!$command->isEnabled()) {
continue;
}
Or by removing src/Commands/LeftChatParticipantCommand.php. But the real solve is having the getCommandsList method in Telegram check whether the getCommandClass returned a Command object.
from core.
I've pull a commit that fix the help command. Just wait the merge or get
the code from my repository.
On 8 Aug 2015 20:45, "Doranku" [email protected] wrote:
The problem there is a non object in the getCommandsLists
('leftchatparticipant' => false)To prevent this from having a working bot, the symptom can be avoided with
following patch.--- a/src/Commands/HelpCommand.php
+++ b/src/Commands/HelpCommand.php
@@ -37,6 +37,10 @@ class HelpCommand extends Command
$msg = 'GeoBot v. ' . $this->telegram->getVersion() . "\n\n";
$msg .= 'Commands List:' . "\n";
foreach ($commands as $command) {
if(!is_object($command))
{
continue;
} if (!$command->isEnabled()) { continue; }
Or by removing src/Commands/LeftChatParticipantCommand.php. But the real
solve is having the getCommandsList method in Telegram check whether the
getCommandClass returned a Command object.—
Reply to this email directly or view it on GitHub
#19 (comment)
.
from core.
That is a "lazy way" patch :)
I meant fix the source of the problem:
--- a/src/Telegram.php
+++ b/src/Telegram.php
@@ -193,6 +193,10 @@ class Telegram
if (substr($name, -11, 11) === 'Command.php') {
$name = strtolower(str_replace('Command.php', '', $name));
$commands[$name] = $this->getCommandClass($name);
+ if(!($commands[$name] instanceof \Longman\TelegramBot\Command))
+ {
+ unset($commands[$name]);
+ }
}
}
@@ -209,7 +213,11 @@ class Telegram
$name = $fileInfo->getFilename();
if (substr($name, -11, 11) === 'Command.php') {
$name = strtolower(str_replace('Command.php', '', $name));
$commands[$name] = $this->getCommandClass($name);
+ if(!($commands[$name] instanceof \Longman\TelegramBot\Command))
+ {
+ unset($commands[$name]);
+ }
}
}
}
from core.
Commits has been merged
from core.
Related Issues (20)
- Bot API 6.8
- Processing messages from the group does not work HOT 4
- How to define a file name when saving a file locally? HOT 2
- Using static methods is bad idea HOT 5
- Unable to add a command that handles web_app_daa HOT 2
- Bot API 6.9
- Can't have more than 1 class for generics messages
- Bot so slow work...
- getUpdates Fatal error when no connection
- How to send message outside webhooks? HOT 1
- sendDocument doesn't have option to specify only file_id as String to send a file that exists on the Telegram servers HOT 2
- Need help basic flow getUpdates HOT 2
- /chats * with multiple bots HOT 1
- Chat boost
- LoginUrl and Page Security
- MessageOrigin
- forward inline_keyboard with data to command HOT 3
- CallbackqueryCommand -> executeCommand HOT 2
- Bot API 7.0
- Parallel commands HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from core.