Skip to content
OptimumMeans edited this page Dec 23, 2024 · 1 revision

Welcome to the TRMNL Discord Bot Wiki

The official TRMNL Discord Bot connects your community to the latest TRMNL resources, documentation, updates, and more. Use this wiki to learn about setup, configuration, features, and development practices.


Table of Contents

  • Getting Started

  • Features Overview

  • Commands

  • Configuration

  • Development Guide

  • Support


Getting Started

Follow these steps to set up the TRMNL Discord Bot:

Prerequisites

  • Python 3.11 or higher

  • Discord Bot Token (obtainable from the Discord Developer Portal)

  • Configuration Files

Installation

  1. Clone the repository:

    git clone https://github.com/usetrmnl/discord-bot.git
    cd discord-bot
  2. Create and activate a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Configure the bot:

    • Copy .env.template to .env and fill in the DISCORD_TOKEN.

    • Update config.json with command prefixes and other settings.

  5. Run the bot:

    python bot.py

Features Overview

The TRMNL Discord Bot offers the following capabilities:

  1. Resource Access: Provides links to TRMNL documentation, frameworks, and tools.

  2. Community Updates: Shares the latest blog posts and news from TRMNL.

  3. DIY Guides: Offers guidance on custom setups and integrations.

  4. Admin Tools: Includes commands for syncing and reloading documentation.

  5. User Feedback: Collects feedback directly from Discord members.

  6. Search Functionality: Allows users to search documentation with a simple command.


Commands

Here is a list of available commands:

Command | Description -- | -- /home | Access main TRMNL resources /docs | View documentation links /framework | Get framework documentation /news | See the latest TRMNL news /updates | View all blog posts and updates /privacy | Access the privacy policy /terms | View the terms of service /diy | Learn about DIY TRMNL options /search | Search TRMNL documentation /status | Show bot status and latency /feedback | Submit user feedback /support | Get support information /changelog | See recent bot updates /pipeline | View upcoming features and roadmap

Configuration

Environment Variables

  • DISCORD_TOKEN: Your Discord Bot Token.

config.json

  • Command Prefix: Customize the prefix for hybrid commands.

  • Feedback Channel ID: Specify a channel for user feedback.

docs.json

  • Manage documentation links, resources, and categories for bot responses.


Development Guide

Adding New Commands

  1. Navigate to src/bot/trmnl.py.

  2. Create a new method in the TRMNL class, using the @app_commands.command decorator.

  3. Implement the command logic, ensuring proper error handling and response formatting.

Updating Documentation

  • Edit docs.json to add or modify documentation categories and links.

Running Tests

  • Use pytest for testing:

    pytest
  • Tests are located in the tests directory.


Support

If you encounter issues or have questions, join the TRMNL Discord Community for support.


Thank you for contributing to and using the TRMNL Discord Bot! Together, we make TRMNL accessible and efficient for all.