Skip to content

msawatzky75/discord-bot-js

Repository files navigation

Marty Bot

Marty Latest Marty Nightly

Setup

Requirements: Yarn, Node (v16) OR Docker, Docker Compose

This project uses zero-install yarn, meaning you do not have to run a separate install step. All the dependancies are already there.

  1. Clone this repository.

  2. Create your environment by copying the .env.default file to .env and add your token and configuraton

    $ cp .env.default .env
    
  3. Add ide helpers to your workspace:

    $ yarn dlx @yarnpkg/sdks vscode
    
  4. Build the bot using this command:

    $ yarn build
    
  5. You're done! You can run the bot with

    $ yarn start
    

Using Docker

If you choose to use docker to run the bot, you can use the following commands:

$ docker-compose up --build

or if you dont want to use docker-compose:

$ docker build . --tag marty-bot:latest
$ docker run marty-bot:latest

Development

There are some commands to help you develop the bot:

  1. To rebuild the bot every time you save a file:

    $ yarn watch
    
  2. To start the development server, and restart it every time you save a file:

    $ yarn dev
    

First Time Setup

In order for the slash commands to work, they need to be registered before the bot can process them. This is done automatically when the AUTO_REGISTER environment variable is set to true.

FAQ

If you're having trouble with vscode not showing types correctly, switch the typescript version to the one located in the .yarn/sdks/typescript/lib folder