Skip to content

Upgrading to 0.63 breaks everything #1114

Closed
@jacklul

Description

@jacklul

While using Longman\TelegramBot\Commands namespace for commands getUpdates (Windows, not tested on linux) method errors out:

Fatal error: Cannot declare class Longman\TelegramBot\Commands\SystemCommands\CallbackqueryCommand, because the name is already in use in vendor\longman\telegram-bot\src\Commands\SystemCommands\CallbackqueryCommand.php on line 20

Tried changing namespaces of all my commands to match my project and filepath but after that they are not loaded at all - regex doesn't seem to match (it does after I change it to #namespace\s+(.+?);#sm).
Another thing: Telegram::runCommands() doesn't work in this release for me.

Summoning @Jonybang @noplanman

Personally they way this custom namespace feature is implemented - loading files and running regex on them (three times for user/system/admin auth) is not really good idea. This could've been probably implemented by adding a separate method for the user to define their custom namespace instead. Possibly multiple calls were caused by the bug itself, needs more investigation and optimization in the future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions