GrafeasGroup / buttercup

Our personal assistant in Discord
MIT License
5 stars 2 forks source link

Add timestamps to `/search` results #120

Closed TimJentzsch closed 2 years ago

TimJentzsch commented 2 years ago

Relevant issue: Closes #119

Description:

This adds localized, relative timestamps to the results of the /search command. This should make it easier to identify the exact post that you are looking for.

Additionally, the way that the query occurrences are displayed has been improved. It now shows as much "context" to the occurrence as possible on both sides, while still fitting in a single line (on a Desktop embed). Before, it would sometimes wrap into the next line if the query string was long, or the result was truncated when there was still room left.

Screenshots:

The updated result of the `/search` command. It now displays relative timestamps, such as "3 months ago" for each result. It also shows more context to the query occurrences while still keeping them in a single line.

Checklist: