ProjectMoon / matrix-dicebot

This repository is mirrored from: https://git.agnos.is/projectmoon/matrix-dicebot
https://git.agnos.is/projectmoon/matrix-dicebot
Other
4 stars 1 forks source link

Implement actor pattern for state, refactor bot code. #10

Closed ProjectMoon closed 4 years ago

ProjectMoon commented 4 years ago

Instead of using an Arc Mutex for state management embedded directly into the bot, utilize actor pattern, with the idea that this will be much more useful than simply logging a message once in the future.

This also refactors the bot code so that instead of a single run_bot function, the DiceBot struct now has a run() method attached to it. This also necessitated changes and cleanup to the dicebot main, which is for the better anyhow.