rikai / Showbot

🤖 An omnipresent multi-platform bot who's goal in life is become Skynet 🤖
MIT License
40 stars 18 forks source link

Feature/live quotes editing #59

Closed s0ph0s-dog closed 8 years ago

s0ph0s-dog commented 8 years ago

This pull request aims to add live editing to the quotes plugin. This enables the bot owner and, optionally, channel operators, to add quotes to the quote list, without manually editing quotes.yml.
It also moves the file handling code into the data model, abstracting it away from the view.

If you don't want this as part of canonical Showbot, that's fine. I wrote it mostly for practice, since I only learned Ruby last Sunday.

-s0ph0s

rikai commented 8 years ago

Discussion on the PR from IRC:

<nelsk> PR looks okay to me, the one change I'd make is I think cinchize had a framework supported way for parsing commands iirc
<nelsk> The matcher supports argument extraction.

See example here.

See issue #60 for more discussion, as this needs to be solved and the PR updated before it can be accepted.

eriknelson commented 8 years ago

Argument extraction example in the DO bot functions

Regex groups get passed through.

s0ph0s-dog commented 8 years ago

And that fixes it to use the admin plugin. Non-exhaustive testing shows it to work properly in most normal cases.

rikai commented 8 years ago

Looks good!