Skip to content

SamuelNunesDev/bot-discord-service

Repository files navigation

Notifications via discord bot

🤔 About the service

👨‍💻 Installation

  1. After cloning the project, run:
composer install
  1. Create a Discord application.

  2. Click the Create a Bot User button on your Discord application.

  3. Paste your bot's API token, found under App Bot User, in your services.php config file:

    // config/services.php
    'discord' => [
        'token' => 'YOUR_API_TOKEN',
    ],
  1. Add the bot to your server and identify it by running the artisan command:
    php artisan discord:setup

🧐 How to use

  • Make a post request (example: http://localhost:8000/api/send):
  • The "message" attribute generates a simple text message.
  • The "embed" attribute is an object and each attribute is responsible for generating an embed.
  • The "channel_id" attribute is the id of the channel where you want to send the message.
$ curl -d '{
  "message": "",
  "embed": {
    "title": "Embed Title",
    "type": "rich",
    "description": "content embed",
    "color": "777",
    "timestamp": "2022-04-18T22:42Z"
  },
  "channel_id": "000000000000"
}' -H 'Content-Type: application/json' http://localhost:8000/api/send

Releases

No releases published

Packages

No packages published

Languages