Sign inSign up

torqdl/discord-bot

By torqdl

•Updated about 4 years ago

Image
0

496

torqdl/discord-bot repository overview

⁠TORQ Discord Bot

Build & Publish Docker Image to Docker Hub Lint Docker Image Version Docker Pulls Supported Platforms

A command and control bot for the TORQ Digital Labs Discord server.

⁠Features

  • Easy Installation
  • Easy Configuration
  • Simple to Use
  • Docker Secrets Support

⁠Requirements

  • A host with Docker installed.
  • A host on a supported CPU architecture: armv6 | armv7 | armv8 | amd64

⁠Commands

These commands can be issued by users on the server, and if the user is a member of a role with access to run that command, the command will be processed. Otherwise, an error will display, letting the user know that they aren't a member of the right role.

CommandOptionExampleDescription
/avatartarget/avatar target:@Tyrelius#0001Get the avatar URL of the selected user, or your own avatar.
/beep-/beepBeep!
/kicktarget/kick target:@Tyrelius#0001Select a member and kick them (but not really).
/options-infoinput/options-info input:This is an example.Information about the options provided.
/ping-/pingReplies with Pong!
/pruneamount/prune amount:10Prune up to 99 messages.
/server-/serverDisplay info about this server.
/user-info-/user-infoDisplay info about yourself.

⁠Running the TORQ Discord Bot

Before you run the TORQ Discord Bot's Docker container, you'll need to set up the bot inside of Discord at the Discord Developer Portal⁠.

⁠Discord Setup

TODO: Add instructions for setting up the Discord bot.

⁠Docker Setup

If you haven't installed Docker yet, install it by running:

$ curl -sSL https://get.docker.com | sh
$ sudo usermod -aG docker $(whoami)
$ exit

Then log out and log back in again, or reboot.

To automatically install & run the TORQ Discord Bot, simply run:

$ docker run -d \
  --name=torq-discord-bot \
  -e DISCORD_BOT_TOKEN=your_discord_bot_token \
  -e DISCORD_BOT_CLIENTID=123456789012345678 \
  -e DISCORD_SERVER_GUILDID=876543210987654321 \
  -v ~/.torq-discord-bot:/usr/src/APP \
  --restart unless-stopped \
  torqdl/discord-bot

💡 Replace your_discord_bot_token with your Discord bot's token.

💡 Replace 123456789012345678 with your Discord bot's OAuth2 client ID.

💡 Replace 876543210987654321 with the Server ID of the server this Discord bot will run on.

💡 Your configuration file can be saved in ~/.torq-discord-bot

⁠Docker Compose

If you'd like to add the TORQ Discord Bot to a docker-compose, you can begin with this example:

Add this to /opt/compose/docker-compose.yaml and run it with

$ docker-compose -f /opt/compose/docker-compose.yaml up -d
version: '3.7'
services:
  torq-discord-bot:
    image: torqdl/discord-bot:latest
    container_name: discord-bot
    restart: unless-stopped
    environment:
      # ⚠️ Required if not using a config.json file in a volume:
      DISCORD_BOT_TOKEN: "your_discord_bot_token"
      DISCORD_BOT_CLIENTID: "123456789012345678"
      DISCORD_SERVER_GUILDID: "876543210987654321"
      # ⚠️ Highly recommended to use Docker secrets,
      # especially if you commit this code to a repo:
      DISCORD_BOT_TOKEN_FILE: /run/secrets/token
      DISCORD_BOT_CLIENTID_FILE: /run/secrets/clientId
      DISCORD_SERVER_GUILDID_FILE: /run/secrets/guildId
    volumes:
      # ⚠️ Required if not using environment variables,
      # so that you can enter your config.json file:
      - /opt/torq-discord-bot:/usr/src/APP
    secrets:
      - token
      - clientId
      - guildId
secrets:
  token:
    file: /opt/compose/.secrets/token.txt
  clientId:
    file: /opt/compose/.secrets/clientId.txt
  guildId:
    file: /opt/compose/.secrets/guildId.txt

⁠Configuration

TODO: Add instructions for using the config.json file, or using the environment variables.

⁠Updating

To update to the latest version, simply run:

$ docker stop torq-discord-bot
$ docker rm torq-discord-bot
$ docker pull torqdl/discord-bot

And then run the docker run -d \ ... command above again.

If you are using Docker Compose, you can update with:

$ docker-compose -f /opt/compose/docker-compose.yaml pull
$ docker-compose -f /opt/compose/docker-compose.yaml up -d

⁠Change Log

⁠1.0.0
  • Initial release of the TORQ Discord Bot.

⁠Releases

There are three main releases available from Docker Hub:

  • :latest is the latest production release.
  • :nightly is the latest build from the master branch, but may not be ready for production release.
  • :development is the latest development build.

Additionally, you may pull individual versions from each branch.

  • Production: :1.1.0
  • Nightly: :1.1.0-nightly
  • Development: :1.1.0-dev

Tag summary

Content type

Image

Digest

sha256:5d360c0bd…

Size

72.4 MB

Last updated

about 4 years ago

docker pull torqdl/discord-bot:1.0.0-nightly