Stop sending garbage with emojis (<:mintu:345345879837495>), send just :mintu:
Also takes into account that animated gifs have a in front of them: <a:fishsteer:885601242930372668>
The regex searches for a tag <a:name:000000> where a is optional, the name can be anything but it cannot contain : character, and at the end before the closing tag there must be one or more numbers.
The regex uses g flag to replace all instances of the found pattern from the message.
The instances are replaced with a subgroup that is :name: captured from the searched pattern.
Partially fixes https://github.com/UniversityOfHelsinkiCS/toska-silta/issues/2 Fixes:
<:mintu:345345879837495>
), send just:mintu:
Also takes into account that animated gifs have
a
in front of them:<a:fishsteer:885601242930372668>
The regex searches for a tag
<a:name:000000>
wherea
is optional, the name can be anything but it cannot contain:
character, and at the end before the closing tag there must be one or more numbers. The regex usesg
flag to replace all instances of the found pattern from the message. The instances are replaced with a subgroup that is:name:
captured from the searched pattern.