discord-php / DiscordPHP

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

Argument 1 passed to Discord\Discord::__construct() must be of the type array, #130

Closed shibdib closed 8 years ago

shibdib commented 8 years ago

PHP Catchable fatal error: Argument 1 passed to Discord\Discord::__construct() must be of the type array, string given, called in /home/Dramiel/Dramiel.php on line 82 and defined in /home/Dramiel/vendor/team-reflex/discord-php/src/Discord/Discord.php on line 282

I'm stumped, error came out of nowhere after a bot restart

Line in question $discord = new Discord($config["bot"]["token"]);

config section $config["bot"] = array( "name" => "TWINKIE NUMBA UN", // Discord name for your bot "game" => "USA #1", "trigger" => "!", // what trigger is used for commands "token" => "token", //enter the token for your app https://discordapp.com/developers/applications/me );

shibdib commented 8 years ago

$discord = new Discord(["token" => $config["bot"]["token"]]);

^ fix