codeforamerica / glossary-bot

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

add support for multiple definitions #27

Open tmaybe opened 9 years ago

tmaybe commented 9 years ago

Currently, Gloss Bot only allows you to set one definition per term. Instead, we could save multiple definitions per term and offer a relatively simple interface for manipulating them. So

/gloss EW = Eligibility Worker

Would get you the definition

EW
Eligibility Worker

Then

/gloss EW = Entertainment Weekly

Would show

EW
1. Eligibility Worker
2. Entertainment Weekly

Move a definition

/gloss move EW 2 to 1

EW
1. Entertainment Weekly
2. Eligibility Worker

Delete a definition

/gloss delete EW 1

EW
1. Eligibility Worker

Replace a definition

/gloss EW 1 = Entertainment Worker

EW
1. Entertainment Worker

Is it too complicated?

migurski commented 9 years ago

A little complicated, and a lot risky. Two people trying to do this at the same time will walk all over each other. Better to assign numbers when definitions are created, and never let them change. It might make for weird “1. 3. 4.” kinds of lists.

tmaybe commented 9 years ago

It might be better to have the bot start maintaining state, so you can express your intention with a simple command and then it can ask you for refinement. Like if you typed \gloss delete EW and EW had more than one definition, it would ask you to tell it which definition you wanted to delete.