Closed parapauk closed 7 years ago
Looks like your token is invalid or you have it registered wrong. Double check it and make sure it doesn't include "Bot " at the beginning
Hi,
this is the code within my bot file:
`<?php
include DIR.'/vendor/autoload.php';
$discord = new \Discord\Discord([ 'token' => 'MzA5NDQwNjc2ODc2MjU1MjMz.C-zIhQ._pdgWDDO4eOyzj5lIVjT2_lnLwg', ]);
$discord->on('ready', function ($discord) { echo "Bot is ready.", PHP_EOL;
// Listen for events here
$discord->on('message', function ($message) {
echo "Recieved a message from {$message->author->username}: {$message->content}", PHP_EOL;
});
});
$discord->run(); `
It's definitely the same token as shown on the https://discordapp.com/developers/applications/me/ page
Why are you sharing your bot token?
Thanks, pazuzu for the assistance! Oh, wait. It's an old key.
It's a serous question. You shouldn't share tokens.
Sorry which part of my very serious answer didnt you get?
Tokens in this case don't mean jack, simple to delete it or refresh it once he gets his answer. Provide some help to the actual issue or don't comment at all
Hi,
I have set it up as per the instructions and registered a bot with discord. I put the bot's auth token into the bot.php file as per the documentation, but when it runs I get the following:
PHP Fatal error: Uncaught exception 'Discord\Exceptions\DiscordRequestFailedException' with message 'Erorr code 401: There was an error processing the request. UNAUTHORIZED - {"code": 0, "message": "401: Unauthorized"} - users/@me' in /root/vendor/team-reflex/discord-php/src/Discord/Helpers/Guzzle.php:212
Can anyone advise please?