ArchWand/1984Bot

Word highlighting in the violation embeds

Closed this issue · 5 comments

Currently, the logging parses all the content, then sends the parsed content in the embed. This means that it doesn't always show things how they actually are. This can be fixed by sending message.content in the embed instead. However, this is difficult to highlight.

This will be handled in the blacklist-rework branch.

Design

Start at character index 0. Apply parseContent(), and check for a match at the start. Record the index if it is a match.
Repeat starting from the back, again recording the index.
This is stored to a dictionary.

The sections of the string denoted by the index is replaced with a hyperlink.

Note: regex to match discord links:

https?:\/\/.*\/

This is slower. I need to test the time each version takes.

Oh this is done now