Skip to content

denkbares/PollMatrixBot

 
 

Repository files navigation

PollMatrixBot

simplematrixbotlib

A handy bot for creating and managing polls in Matrix rooms.

Features

  • !create title: Create a new poll with the specified title.
  • !close: Close the current poll.
  • !remove : Remove the given item from the poll.
  • !list: List all items currently in the poll.
  • !add : Add a new item to the poll (if enabled in the configuration).
  • !help: Display the help message with available commands.

Installation

Prerequisites

  • A Matrix account (Sign up at Matrix.org)
  • Python 3.x

Using Docker Compose (Recommended)

  1. Clone the repository:

    git clone https://github.com/bennocrafter/pollmatrixbot.git
    cd PollMatrixBot
  2. (Recommended) Build the Docker image:

docker-compose build
  1. Start the bot in detached mode:
docker-compose up -d

Running without Docker (Not Recommended)

  1. Install required dependencies:
pip install -r requirements.txt
  1. Run the main script:
python main.py

Commands

The Matrix Poll Bot supports the following commands:

  • !create title: Creates a new poll with the specified title.
  • !close: Closes the current poll and displays a status report.
  • !remove : Removes the given item from the current poll (if enabled).
  • !list: Lists all options currently available in the poll.
  • !add : Adds a new option to the current poll (if enabled, configurable).
  • !help: Displays the help message with available commands.

Configuration

Create a .env file in the project's root directory with the following environment variables:

USERNAME=your-matrix-username
PASSWORD=your-matrix-password
HOMESERVER=your-matrix-homeserver

Configure other things in assets/config.yaml

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.2%
  • Dockerfile 0.8%