discord-php / DiscordPHP

An API to interact with the popular messaging app Discord
MIT License
1k stars 237 forks source link

PHP Fatal error: Uncaught Error: Call to undefined method Discord\CommandClient\Command::addSubCommandAlias() #195

Closed Hissvard closed 7 years ago

Hissvard commented 7 years ago

Trying to register a subCommand using registerSubCommand(), I got the following error: PHP Fatal error: Uncaught Error: Call to undefined method Discord\CommandClient\Command::addSubCommandAlias() in /home/<username>/<botname>/vendor/team-reflex/discord-php/src/Discord/CommandClient/Command.php:99

I got it fixed easily by changing foreach ($options['aliases'] as $alias) { $this->addSubCommandAlias($alias, $command); } to foreach ($options['aliases'] as $alias) { $this->registerSubCommandAlias($alias, $command); }

I am though unsure whether this is a bug in the code or I just used the method in the wrong way. Anyone else had this problem before?

davidcole1340 commented 7 years ago

Thanks!