Commit graph

24 commits

Author SHA1 Message Date
5ba796086a Update Dockerfile to use ruby3.0-alpine 2021-07-11 14:37:32 -04:00
6416c76891 custom_commands.rb: Syntax fixes 2021-03-26 20:46:48 -04:00
4a2490b872 Update Gems for Ruby 3 2021-03-26 20:46:30 -04:00
1ddc0746ca Add configuration for Yard 2021-03-26 20:46:02 -04:00
32c07cd99c Add gitignore file 2021-03-07 17:13:46 -05:00
c10b847e81 Add Yard, and begin some documentation
Use Yard to generate documentation. Included in the `.yardopts` file is
configuration to also publish the markdown files in the `wiki/`
directory.

wiki/
- addons.md: Information on writing new addons.
- database.md: Information on using the database and migrations

db/migrate/*: Rename in accordance with documentation

Rakefile: Add the Yard Rake tasks
2021-03-07 16:57:27 -05:00
ce06aa568b Refactor for ActiveRecord and Config Files
Update Custom Commands to leverage ActiveRecord and save commands to a
database. By default, it will use SQLite. Configuration for this (and
potential configuration for PostgreSQL and MySQL) live in
`config/db.yml`. Inculde a Rakefile for handling DB creation and
migrations.

Rakefile: Add Rakefile to handle running the bot, and DB management
Gemfile: Update with new gem dependencies
db/migrate/*: ActiveRecord migrations for Custom Command
custom_commands.rb: Update to leverage ActiveRecord

Leverage the Rakefile to start the bot, removing the binary file. Update
the Dockerfile to also leverage the Rakefile.

Dockerfile: Update to use Rakefile, and install new dependencies
chronicle: Remove unnecessary start file

Refactor the `chronicle_bot` file into `chronicle` and `matrix`

chronicle.rb: General Chronicle setup
matrix.rb: Start a Matrix-specific bot

Update the bot to read configuration from files, instead of either the
environment, or hard-coded values.

config/db.yml: Database configuration
config/bot.yml: General bot configuration

Update the README to reflect the above change with regards to running
the bot either using the Rakefile, or using a Docker container.
2021-02-27 19:55:43 -05:00
b919de11f5 Add Docker capabilities
README.md: Update with Docker instructions
Dockerfile: Add file
2021-02-16 23:15:50 -05:00
f6171eed20 chronicle: Update to reflect environmental var usage 2021-02-16 23:15:18 -05:00
22c9590816 Update help_command logic
The `help_command` method for each addon/the bot were not returning the
help message, but were instead sending the help messages themselves.
Update the logic to simply return the help message string.
2021-02-16 23:13:46 -05:00
69a22c8a22 Add help and listcommand logic
Both `!help` and `!listcommand` are handled by the bot itself, so take
advantage of how the addons method calls work to implement both
`matrix_command` and `help_command` on `self`.

Add `help_command` to each currently enabled and functional addon
2021-02-14 22:39:31 -05:00
0e942a58c1 README: Update available functionality 2021-02-14 21:17:50 -05:00
b8ffa3db28 Custom Commands: Make custom commands dynamically
With the updated means of handling addons, update Custom Commands to
include the new logic and be functional.

addons/custom_commands.rb: Update for new addons logic
2021-02-14 21:12:13 -05:00
6fe1a7a251 Update how Addons are used
After some more reading, update the logic for handling the addons.

Leverage an "addons module" (Addon), and require that each addon be a
class within that module. Within that class, optionally include a
`self.register` method, which will be called when the bot is
initialized. This method takes one parameter: the bot
instance.Registering the addon adds the bot's instance to an instance of
the addon, and vice versa, allowing the instances to communicate.
Additionally, registering adds the addons commands.

Each registered addon must also include a `matrix_command` method, which
takes the message String from Matrix. The intention here is to include
additional `*_command` methods for different protocols, without having
to change much else. Adding additional protocols will determine how well
that works.

chronicle_bot.rb: Redo addon logic (details above)
addons/utils.rb: Update for new addon logic (details above)
addons/roller.rb: Update for new addon logic (details above)
2021-02-14 21:06:46 -05:00
faa62604ef Add 8ball command 2021-02-07 20:45:54 -05:00
18f56be754 README: Reflect proper feature status 2021-02-07 15:30:41 -05:00
bc6fb9534f addons/custom_commands: Custom, text-based commands 2021-02-06 22:28:30 -05:00
41c97ccf15 Use the MIT License, at least for now 2021-02-06 22:27:29 -05:00
5938547e05 addons/roller: A capable die roller 2021-02-06 22:24:07 -05:00
1a7b4bb970 addons/utils: Simple chat commands 2021-02-06 22:23:51 -05:00
1a422b65d0 chronicle_bot: An ambitious chat bot for Matrix 2021-02-06 22:23:26 -05:00
24bd7553fa Add very basic Chronicle run script 2021-02-06 22:23:04 -05:00
cd00a6a150 Add README and Gemfile 2021-02-06 22:20:33 -05:00
Bill Niblock
574cc2d77d Init 2020-04-29 22:57:06 -04:00