mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 00:29:02 +01:00
[MIRROR] [s] send2adminchat now stops links from embedding. (#1563)
* Merge pull request #54757 from Ghommie/Ghommie-tg33 [s] send2adminchat now stops links from embedding. * [s] send2adminchat now stops links from embedding. Co-authored-by: Jordan Brown <Cyberboss@users.noreply.github.com>
This commit is contained in:
co-authored by
Jordan Brown
parent
d7c52b681a
commit
fb51a5166b
@@ -66,7 +66,9 @@ In TGS3 it will always be sent to all connected designated game chats.
|
||||
* category - The category of the mssage.
|
||||
* message - The message to send.
|
||||
*/
|
||||
/proc/send2adminchat(category, message)
|
||||
/proc/send2adminchat(category, message, embed_links = FALSE)
|
||||
category = replacetext(replacetext(category, "\proper", ""), "\improper", "")
|
||||
message = replacetext(replacetext(message, "\proper", ""), "\improper", "")
|
||||
if(!embed_links)
|
||||
message = GLOB.has_discord_embeddable_links.Replace(message, "<$1>")
|
||||
world.TgsTargetedChatBroadcast("[category] | [message]", TRUE)
|
||||
|
||||
@@ -5,3 +5,6 @@ GLOBAL_DATUM_INIT(is_website, /regex, regex("http|www.|\[a-z0-9_-]+.(com|org|net
|
||||
GLOBAL_DATUM_INIT(is_email, /regex, regex("\[a-z0-9_-]+@\[a-z0-9_-]+.\[a-z0-9_-]+", "i"))
|
||||
GLOBAL_DATUM_INIT(is_alphanumeric, /regex, regex("\[a-z0-9]+", "i"))
|
||||
GLOBAL_DATUM_INIT(is_punctuation, /regex, regex("\[.!?]+", "i"))
|
||||
|
||||
//finds text strings recognized as links on discord. Mainly used to stop embedding.
|
||||
GLOBAL_DATUM_INIT(has_discord_embeddable_links, /regex, regex("(https?://\[^\\s|<\]{2,})"))
|
||||
|
||||
Reference in New Issue
Block a user