Skip to content

FreeYourStream/freeyourstream-discord-bot

 
 

Repository files navigation

tauri-discord-bot

This bot is based off of the amazing Svelte Bot. It's hosted on a DigitalOcean App instance that will automatically detect any updates to the main branch and deploy those changes.

Configuration

  • Environment: All secrets should be in a .env file. The template/example can be found at env.example
    • NODE_ENV: Any value other than production will set the bot use the dev IDs defined below
    • DISCORD_TOKEN: The bot's private token from Discord
    • DEV_GUILD_ID: Guide/server to test the bot in
    • DEV_ADMIN_ROLE: A role or user ID that the bot will consider an administrator
    • DEV_HELP_CHANNEL: Channel(s) to automatically thread any messages in (see the Threads functionality below)
  • src/config.ts: The bots main config is located at src/config.ts
    • ADMIN_ROLES: Role or user IDs that the bot will consider administrators
    • BOT_DEVS: Currently the same functionality as ADMIN_ROLES
    • HELP_CHANNELS: Channel(s) to automatically thread any messages in (see the "Threads" functionality below)
    • AUTO_THREAD_CHANNELS: Currently the same values as HELP_CHANNELS

Events

  • on_message_auto_thread: Monitors the channels set in AUTO_THREAD_CHANNELS and automatically turns any messages posted there into their own threads

Commands

  • thread: These are commands to manage the autothreads created by the bot. They can be used by the person who initiated the thread or by people/roles defined in the role.
    • /thread rename: Renames the current thread
    • /thread solve: Removes ? and adds ✅ at the beginning of the thread name and sets the archive duration to 1hr
    • /thread archive: Archive an active thread without marking it as solved
    • /thread reopen: Reopen a thread that's been accidentally marked as solved

Stack

Click on the links below to view the documentation on the different parts of the bot's tech stack:

Contributing

All contributions are welcome, please try and make an issue first since most new features might warrant a discussion beforehand. Bug fixes probably won't need an issue and direct pull requests are ok for them.

Running for development

  1. Once you have the bot cloned then you need to make a .env file and fill out the fields:

    cp .env.example .env
  2. Run the bot with yarn dev

Code Conventions

Since there is no user facing code, prefer snake_case for variables and function names wherever possible. Local constants follow the same, whereas global constants should be in SCREAMING_SNAKE_CASE.

Deploying

The bot uses the tsm module loader to transpile its Typescript code on the fly so there's no build step involved.

yarn start

About

FreeYourStream's Discord Bot

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • TypeScript 99.3%
  • Other 0.7%