Skip to content

ist-bot-team/ist-discord-bot

Repository files navigation

IST Discord Bot

GitHub tag (latest by date) Discord GitHub

Discord bot to manage the IST Hub server -- join here.

Running

Production

  1. Create a docker-compose.yml file as below:
version: "3.8"

services:
    ist-discord-bot:
        ## EITHER:
        image: ghcr.io/ist-bot-team/ist-discord-bot:2
        ## OR:
        build:
            context: .
            dockerfile: Dockerfile.dev
            args:
                DATABASE_URL: file:/app/data/bot.db
        ## END;
        volumes:
            - type: bind
              source: ./data
              target: /app/data
        environment:
            DISCORD_TOKEN: PLACE_BOT_TOKEN_HERE
            GUILD_ID: PLACE_MAIN_GUILD_ID_HERE # or "GLOBAL" to use in multiple guilds (1hr roll-out time)
            ADMIN_ID: PLACE_ADMIN_ROLE_ID_HERE
            ADMIN_PLUS_ID: PLACE_ADMIN_PLUS_ROLE_ID_HERE
            COMMAND_LOGS_CHANNEL_ID: PLACE_LOGGING_CHANNEL_ID_HERE
            TZ: Europe/Lisbon # default timezone for crontab and other date related stuff
        restart: unless-stopped
  1. Create a folder named data for Docker to store things in
  2. Run docker-compose up -d --build
  3. That's it!

You can also use docker-compose down, docker-compose up, docker-compose restart and docker-compose logs [-f].

Adding to a Server

Replacing CLIENT_ID with the application's public ID, access the following link:

https://discord.com/oauth2/authorize?client_id=CLIENT_ID&scope=bot+applications.commands&permissions=8

The bot needs the Server Members Intent and the Message Content Intent enabled on Discord's Application -> Bot page. If this is not enabled, an error will be thrown on startup.

Development

If you're looking at the source code, you should probably run

npx prisma generate

first so you can have typings.