Skip to content
LizardByte icon

support-bot

Discord and reddit bot to help manage LizardByte communities.

GitHub Workflow StatusCodecovSonarCloud

Overview

Support bot written in python to help manage LizardByte communities. The current focus is Discord and Reddit, but other platforms such as GitHub discussions/issues might be added in the future.

Discord Slash Commands

commanddescription
/helpReturn help message, for a list of all possible commands

Instructions

Discord

  • Setup an application at discord developer portal.
  • On Bot page enabled these:
    • Presence Intent
    • Server Members Intent
    • Copy the Token

Reddit

Environment Variables

  • Add the following as environment variables or in a .env file (use sample.env as an example).

Tip

If using Docker, these can be arguments.

Warning

Never publicly expose your tokens, secrets, or ids.

variablerequireddefaultdescription
DATA_REPOFalsehttps://github.com/LizardByte/support-bot-dataRepository to store persistent data. This repository should be private!
DATA_REPO_BRANCHFalsemasterBranch to store persistent data.
DISCORD_AUTOBAN_CHANNEL_IDFalseNoneChannel ID where any message posted results in an automatic ban (7-day message deletion).
DISCORD_BOT_TOKENTrueNoneToken from Bot page on discord developer portal.
DISCORD_CLIENT_IDTrueNoneDiscord OAuth2 client id.
DISCORD_CLIENT_SECRETTrueNoneDiscord OAuth2 client secret.
DISCORD_GITHUB_STATUS_CHANNEL_IDTrueNoneChannel ID to send GitHub status updates to.
DISCORD_LEVEL_UP_CHANNEL_IDFalseNoneChannel ID to send user level up messages to.
DISCORD_LOG_CHANNEL_IDFalseNoneChannel ID to send bot log messages to. This should be a private channel.
DISCORD_REDDIT_CHANNEL_IDTrueNoneChannel ID to send Reddit post updates to.
DISCORD_REDIRECT_URIFalsehttps://localhost:8080/discord/callbackThe redirect uri for OAuth2. Must be publicly accessible.
DISCORD_SPONSORS_CHANNEL_IDTrueNoneChannel ID to send sponsorship updates to.
GIT_USER_EMAILTrueNoneEmail address for git commits.
GIT_USER_NAMETrueNoneUsername for git commits.
GIT_TOKENTrueNoneGitHub personal access token. Must have repo write access. Falls back to GITHUB_TOKEN.
GITHUB_CLIENT_IDTrueNoneGitHub OAuth2 client id.
GITHUB_CLIENT_SECRETTrueNoneGitHub OAuth2 client secret.
GITHUB_REDIRECT_URIFalsehttps://localhost:8080/github/callbackThe redirect uri for OAuth2. Must be publicly accessible.
GITHUB_TOKENTrueNoneGitHub personal access token. Must have read:org
GITHUB_WEBHOOK_SECRET_KEYTrueNoneA secret value to ensure webhooks are from trusted sources.
GRAVATAR_EMAILFalseNoneGravatar email address for bot avatar.
PRAW_CLIENT_IDTrueNoneclient_id from reddit app setup page.
PRAW_CLIENT_SECRETTrueNoneclient_secret from reddit app setup page.
PRAW_SUBREDDITTrueNoneSubreddit to monitor (reddit user should be moderator of the subreddit)
REDDIT_USERNAMETrueNoneReddit username
REDDIT_PASSWORDTrueNoneReddit password
SUPPORT_COMMANDS_REPOFalsehttps://github.com/LizardByte/support-bot-commandsRepository for support commands.
SUPPORT_COMMANDS_BRANCHFalsemasterBranch for support commands.

Install

Install the project and its dependencies:

uv sync --locked

For development (includes test dependencies):

uv sync --locked --extra dev

Run tests:

uv run --locked --extra dev pytest

Start

uv run --locked python -m src
  • Invite bot to server:
    • https://discord.com/api/oauth2/authorize?client_id=<the client id of the bot>&permissions=8&scope=bot%20applications.commands

About

Discord and reddit bot to help manage LizardByte communities.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

4 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages