Kard-bot

command module
v1.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2022 License: AGPL-3.0 Imports: 10 Imported by: 0

README

drawing

Kard-bot

Build CodeQL Docker Image Go Report Card

A discord bot destined for greatness.

Table of Contents

Table of contents generated with markdown-toc

Features

  • Respond to user greetings and goodbyes
  • DnD dice roller
  • Copy-pastas
  • Reddit Roulette
  • Uwu-ifier
  • Print out a help message
  • Let users know when it is Wednesday
  • Daily compliments DM'd to users who opt in
  • Creepy DMs sent to users who opt in
  • Provide "odds" that a user specified event will occur
  • Build memes from provided templates and user provided text
  • Generate a story from a user's prompt
  • Allow server admins to generate and edit a role selection menu
  • Allow users to create embeds
  • Madlibs
  • Inform users when Kard-bot is updated
  • Mock certain questions or phrases
  • "Quack" any time a user types an expletive
  • Subscribe to social media accounts (maybe a webhook would be more appropriate?)
  • Play music via youtube à la rythm bot
  • Configurably replace words with other words
  • Search and link to DnD wiki articles
  • Allow users to query Google; provide direct links to top results and a link to all results
  • Youtube Roulette

User Guide

This bot is not publicly hosted anywhere. If you want to use it, you can always try hosting it yourself! :)

Hosting Installation

Hosting this bot requires a Discord Bot Token. You can generate one by visiting the Discord Developer Portal, and then creating a new application with an accompanying bot. Give the bot its needed permissions in the OAuth2 section (Be sure to tick the "applications.commands" box!), and then invite it to your server(s) using the link that is generated for you.

Now that the bot is invited, you should see it as an offline user in your server. Now you only need to start the bot backend to bring it online! You have two options:

  1. Using the provided Docker images
  2. Building from source
Host using Docker
Prerequisites
  • A host machine with one of the following system architectures:
    • arm64
    • amd64
    • arm/v7
  • Docker
  • docker-compose
Instructions

Head over to the Releases page and download the tarball for the desired release. These tarballs contain everything needed to get an instance of the bot up and running, provided that the host machine has internet access. Untar it on the host machine. Edit the included .env file to include the bot token you generated earlier. You may also want to set the time zone by setting the TZ variable.

KARDBOT_TOKEN="Your bot token here"
TZ="Your time zone here ex: America/Boise"

With your token in place and your config updated, you can simply run docker-compose up -d from the untarred directory to get your bot started! The Docker daemon will automatically download the needed docker image from Docker Hub or the GitHub Container Registry. To check the status of the docker container, you can use docker ps -a or docker logs <CONTAINER-NAME>.

Building from source
Prerequisites
  • The Go 1.17 runtime or later.
Instructions

Assuming you have the Go runtime installed, you can install Kard-bot with a simple set of shell commands.

go get github.com/TannerKvarfordt/Kard-bot
cd $GOPATH/src/github.com/TannerKvarfordt/Kard-bot
go build

In order to authenticate with Discord, Kard-bot looks for the KARDBOT_TOKEN environment variable. It is recommended to place that variable in a .env file at the root of the project. Note that existing environment variables take precedence over anything in the .env file.

KARDBOT_TOKEN="Your bot token here"

With your token in place and your config updated, you can simply run the Kard-bot binary to bring it to life! For a more robust running solution, consider creating a systemd service or using the provided Docker image.

General Notes

Some commands are restricted so that only the bot owner can run them. The bot owner is specified by the KARDBOT_OWNER_ID environment variable. It can be set in the same manner as the KARDBOT_TOKEN variable. Its value should be the user ID of the bot owner. Note that this is not the same as the owner's username. The user ID is a unique ID assigned by Discord. You can retrieve it by enabling developer mode in your Discord client, right clicking a user, and selecting "Copy ID".

References

Useful resources for writing a Discord bot.

Discord API Wrappers
Documentation
Tutorials

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL