To use Miou in your Matrix room, you need to invite the bot using its Matrix ID (configured in your deployment). Miou will join the room and listen for commands.
You can interact with it by sending messages starting with the prefix !miou. For example, to see the help message, you can send:
!miou helpAll available commands are listed below:
games: list all the ongoing gamesalerts: list your registered alertsregister <game_id> <player_name> <delay_in_minutes>: register a new alertunregister <game_id>: unregister an alerthelp: show this help message
!miou gamesThe games command lists all the ongoing games on the Terraforming Mars server. It shows the game ID, the current phase, and the list of players in each game. Players who are currently taking their turn are marked with an hourglass (⏳).
Response:
Games:
- game_id1(Research), players: Player_1(⏳), Player_2, Player_3(⏳)
- game_id2(Drafting), players: Player_1!miou alertsThe alerts command lists all the alerts you have registered in the current Matrix room. It shows the game ID and the player name for each alert.
Response:
Registered alerts:
- game_id1: Player_1
- game_id2: Player_2!miou register game_id1 Player_1 2The register command allows you to register an alert for a specific game and player. You need to provide the game ID, the player name, and the delay in minutes before the alert is sent. The delay must be between 1 minute and 1 week.
Response:
You have been registered successfully.!miou unregister game_id1The unregister command allows you to unregister an alert for a specific game. You need to provide the game ID.
Response:
You have been unregistered successfully.!miou helpThe help command shows the help message with all available commands.
When you register an alert for a game, Miou will send you a notification in the Matrix room when it's your turn to play. The notification will be sent after the specified delay in minutes.
The bot polls data from the Terraforming Mars server at a configured interval (specified in your config.yaml as polling_interval). The alert triggers after the bot detects that it's the player's turn (depending on the polling interval) and the specified delay has passed.
You can use the following docker-compose.yml file:
services:
miou:
image: florianduros/miou:latest
container_name: miou
restart: unless-stopped
volumes:
# Mount configuration file or/and use environment variables to configure
# - ./miou.yml:/config/miou.yml
- ./data:/data
environment:
# Set log level, info by default
- RUST_LOG=debug
# Override configuration via environment variables
# Use MIOU_ prefix with double underscores for nested paths
- MIOU_TMARS__URL=https://tmars.example.com
- MIOU_TMARS__SERVER_ID=your-server-id
- MIOU_TMARS__POLLING_INTERVAL=120
- MIOU_MATRIX__USER_ID=@miou:matrix.org
- MIOU_MATRIX__PASSWORD=your-password
- MIOU_MATRIX__PASSPHRASE=your-passphrasePrerequisites
- Rust 1.70 or later
- Clone the repository:
git clone https://github.com/florianduros/miou.git
cd miou- Build the project:
cargo build --release-
Create a
config.yamlfile (see Configuration section below) -
Run the bot:
cargo run --release -- --config config.yaml --data ./datacargo install miou
miou --config config.yaml --data ./dataCreate a config.yaml file with the following structure:
# TMars Server Configuration
tmars:
url: "https://terraforming-mars.herokuapp.com"
server_id: "your-server-id"
polling_interval: 120 # seconds between polling the TMars server
# Matrix Account Configuration
matrix:
user_id: "@miou:matrix.org"
password: "your-bot-password"
passphrase: "your-recovery-passphrase"You can override any configuration value using environment variables with the MIOU_ prefix.
Use double underscores (__) to separate nested configuration paths:
export MIOU_TMARS__URL="https://terraforming-mars.herokuapp.com"
export MIOU_TMARS__SERVER_ID="your-server-id"
export MIOU_TMARS__POLLING_INTERVAL="120"
export MIOU_MATRIX__USER_ID="@miou:matrix.org"
export MIOU_MATRIX__PASSWORD="your-bot-password"
export MIOU_MATRIX__PASSPHRASE="your-recovery-passphrase"
miou --config config.yaml --data ./dataEnvironment variables take precedence over values in the YAML file.
tmars.url: Base URL of the Terraforming Mars server- Environment variable:
MIOU_TMARS__URL
- Environment variable:
tmars.server_id: Server identifier for the TMars instancetmars.polling_interval: Seconds between game state polls- Environment variable:
MIOU_TMARS__POLLING_INTERVAL
- Environment variable:
matrix.user_id: Matrix user ID for the bot account- Environment variable:
MIOU_MATRIX__USER_ID
- Environment variable:
matrix.password: Password for the Matrix account- Environment variable:
MIOU_MATRIX__PASSWORD
- Environment variable:
matrix.passphrase: Recovery passphrase for end-to-end encryption- Environment variable:
MIOU_MATRIX__PASSPHRASE
- Environment variable:
Environment Variables: All configuration values can be overridden using environment variables with the MIOU_ prefix. Use double underscores (__) to represent nested paths (e.g., MIOU_TMARS__URL for tmars.url).
--config: Path to the configuration file (required)--data: Directory for storing matrix session data and alerts (required)
The data directory will contain:
session/: Matrix session data and encryption keysalerts: JSON file with registered alerts
Security Note: The data directory contains sensitive information including authentication tokens and encryption keys. Ensure it has appropriate permissions.
