Skip to content

Conversation

jacklul
Copy link
Collaborator

@jacklul jacklul commented Nov 24, 2016

Those are fixes I applied to my bots.

Fixes #331
Addresses latest API update causing library to throw exceptions (channel messages), mentioned #332

@jacklul jacklul changed the title Fixes Fixes for #331and #332 Nov 24, 2016
@jacklul jacklul changed the title Fixes for #331and #332 Fixes for #331 and #332 Nov 24, 2016
 into fixes

# Conflicts:
#	src/Entities/ServerResponse.php
@noplanman
Copy link
Member

@MBoretto have you had a look at this PR too?
@jacklul is this good to merge or more of a quick fix?

@jacklul
Copy link
Collaborator Author

jacklul commented Nov 25, 2016

I haven't been able to test it out with new changes because my local getUpdates test bot returns error on dev branch now: PHP Fatal error: Call to a member function getBody() on null in src\Request.php on line 227

But following the logic in new ServerResponse it should be fine...

@MBoretto
Copy link
Collaborator

No I didn't look so far. @jacklul we need to align this with the new develop to fix the travis fail

@jacklul
Copy link
Collaborator Author

jacklul commented Nov 26, 2016

All should be good now!

@MBoretto
Copy link
Collaborator

yessss

@noplanman noplanman merged commit e101cdf into php-telegram-bot:develop Dec 12, 2016
@jacklul jacklul deleted the fixes branch December 13, 2016 13:47
@noplanman
Copy link
Member

There seems to be another issue with this. Will need to find out the underlying issue here, pin point if-else exceptions aren't so super-duper-awesome...

PHP Fatal error:  Uncaught Error: Call to a member function getFrom() on null in /bot/vendor/longman/telegram-bot/src/Commands/SystemCommands/GenericmessageCommand.php:63
Stack trace:
#0 /bot/vendor/longman/telegram-bot/src/Commands/Command.php(132): Longman\TelegramBot\Commands\SystemCommands\GenericmessageCommand->execute()
#1 /bot/vendor/longman/telegram-bot/src/Telegram.php(465): Longman\TelegramBot\Commands\Command->preExecute()
#2 /bot/vendor/longman/telegram-bot/src/Telegram.php(434): Longman\TelegramBot\Telegram->executeCommand('genericmessage')
#3 /bot/vendor/longman/telegram-bot/src/Telegram.php(362): Longman\TelegramBot\Telegram->processUpdate(Object(Longman\TelegramBot\Entities\Update))
#4 /bot/hook.php(48): Longman\TelegramBot\Telegram->handle()
#5 {main}
  thrown in /bot/vendor/longman/telegram-bot/src/Commands/SystemCommands/GenericmessageCommand.php on line 63

@jacklul
Copy link
Collaborator Author

jacklul commented Dec 24, 2016

That's because we don't have ChannelpostCommand.php and EditedchannelpostCommand.php implemented. Channel messages updates don't carry from field, GenericmessageCommand.php uses that field, that's the error here.

I'll PR it!

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

Successfully merging this pull request may close these issues.

3 participants