Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support lore context #14

Open
christhompson opened this issue Sep 20, 2016 · 1 comment
Open

Support lore context #14

christhompson opened this issue Sep 20, 2016 · 1 comment

Comments

@christhompson
Copy link
Owner

It would be nice to be able to store some of the surrounding context with a piece of lore.

This would be particularly useful in conjunction with lorebot (which could automate gathering some context). For manual use it would likely never be used (since it would require manually collecting the context).

To support non-quoted lore still, it may be best to require this in a specific format, passed as optional flagged arguments to loredb. Perhaps something like:

loredb <author> <lore> -c {context blob} -c {context blob}

Where {context blob} could be some JSON maybe:

{'offset_from_lore': -1, 'text': 'blah', 'author': 'fake user'}

Or the context could just be a plaintext blob of all messages (including the lore) within the desired range.

Then the other commands (such as new, search, random) could support a flag for displaying context (up to some limit), like loredb random -C NUM (to mimic grep flags).

@christhompson
Copy link
Owner Author

A better approach (suggested by @MyNameIsKippo) is to store context lines in a separate table, and connect them with the slack message timestamp.

We can migrate the current schema to add a ts field (and a flag to specify the slack timestamp in loredb add). Then context could be added using a new command like loredb addcontext <ts> <context>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant