Truta446 / discord-bot-template

Generated by https://bohr.io

Home Page:https://discord-bot.bohr.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Discord Bot Template

A simple discord bot template for the bohr.io platform. It uses API endpoints to respond to Interactions with the bot.

Setting your project

  1. In the bohr.io platform start a new project with this template.

  2. Create a Discord application and a bot.

  3. Generate a url in the OAuth2/Url Generator, with the options:

    • SCOPES:

      • applications.commands
      • bot

    • BOT PERMISSIONS:

      • Use Slash Commands
      • Send Messages

  4. Invite the bot to your server using the generated url.

  5. Set the following environment variables on the bohr.io project settings:

    • From your Discord Application General Information page:

      • APPLICATION_ID
      • DISCORD_PUBLIC_KEY

    • From your Discord Application Bot page.

      • DISCORD_BOT_TOKEN

    • From your Discord Client (enable the 'developer mode' under advanced settings. Then right click on your test server)

      • TEST_GUILD_ID

    1. In the discord application General Information, set the INTERACTIONS ENDPOINT URL with the project's interactions api endpoint: https://<PROJECT_URL>/api/interactions

Developing

  1. Create a second Discord application to be your development application.

  2. Start the project locally using the terminal commands:

    git clone <PROJECT_REPOSITORY_URL>
    cd <REPOSITORY_NAME>
    npx -y bohr@latest dev
    
  3. When starting your project locally, a tunnel url to your local project will be provided. Use it for the INTERACTIONS ENDPOINT URL in the development application.


Commands

  • server: send the channel and server that the user is in
  • user: send a mention to the user

About

Generated by https://bohr.io

https://discord-bot.bohr.io


Languages

Language:JavaScript 69.9%Language:HTML 30.1%