core icon indicating copy to clipboard operation
core copied to clipboard

Can't have more than 1 class for generics messages

Open mtalaeii opened this issue 2 years ago • 1 comments

🐞 Bug Report

Required Information

? !
Operating system Ubuntu 22
PHP Telegram Bot version 0.81.0
PHP version 8.2.9
MySQL version mariadb 11
Update Method Webhook
Self-signed certificate no

Summary

This bug is very bad bug actually i want have more than 1 class for generic message .

Current behaviour

This is necessary that the class name is GenericmessageCommand and the $name is genericmessasge to execute generic commands this is my code

class ManagechannelsCommand extends SystemCommand
{
    protected $private_only = true;
    protected $name = 'managechannels';

    /**
     * @inheritDoc
     */
    public function execute(): ServerResponse
    {
        if ($this->getMessage()->getText(true) != '.....') {
            return Request::emptyResponse();
        }
        ......
        return $this->replyToUser('.......');
    }
}

Expected behaviour

I expecte if we dont have usage then the class maybe is one of genericmessage command classes then its just executed with any type of message

mtalaeii avatar Oct 27 '23 12:10 mtalaeii

Hello

Do you still need help with this issue?

Hitmare avatar May 13 '24 09:05 Hitmare