DownloadPing pong bot
In this example you can see a basic bot that responds to a message-based command.
Please note, that for this example to work, you have to enable the Message Content intent in Discords Developer Dashboard. This intent is priviliged, meaning you have to go through verification to use it when you reach a certain number of guilds.
Replace 'TOKEN' with your Discord Bot Token, which you can get from the Discord Developer Dashboard. Then run the file on the terminal with php ping-pong-bot.php. Send !ping in a channel you share with the bot and you should see it respond with pong!.
|