mirror of
https://github.com/fulpstation/fulpstation.git
synced 2025-12-10 01:57:01 +00:00
[s] send2adminchat now stops links from embedding.
This commit is contained in:
@@ -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