codeforamerica / glossary-bot

A Glossary bot for Slack
MIT License
116 stars 45 forks source link

Bugs when trying to set definitions for command words – should it be possible? #14

Closed tmaybe closed 9 years ago

tmaybe commented 9 years ago

Command words are set, delete, help, stats and shh and variations...any number of s's followed by any number of h's.

Right now you can successfully set the definition for help with /gloss help = testing but there's no way to retrieve it. Same thing with set and /gloss set set = testing; delete and /gloss set delete = testing; stats and /gloss set stats = testing; shh and /gloss set shh = testing.

It'd be easy enough to throw an error when trying to set the definition of a command word, but it feels weird to just have no way to set & get definitions for these words. But it'd also be weird to have some elaborate way of escaping command words when setting & getting definitions.

Proposed solution – formalize the behavior above: /gloss set <command> = <definition> will set a definition for a command word. The bot will tell the user how to do that if they seem to be trying to define a command word.

To get definitions, it will either understand from context (i.e. a command like /gloss set, /gloss delete or /gloss shh which don't make sense as commands) or require an explicit get, like /gloss get stats or /gloss get help.

tmaybe commented 9 years ago

I'm handling this as of ee29a075419f3104460fab9a859d1c17396d42a1.

I did a few things: