PHP Classes

File: examples/01-ping-pong-bot.md

Recommend this page to a friend!
  Packages of Max   Fenrir   examples/01-ping-pong-bot.md   Download  
File: examples/01-ping-pong-bot.md
Role: Auxiliary data
Content type: text/markdown
Description: Auxiliary data
Class: Fenrir
Use Discord services using the Web services API
Author: By
Last change:
Date: 4 months ago
Size: 610 bytes
 

 

Contents

Class file image Download

Ping 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!.