Update preferences.dm

adds more link options
This commit is contained in:
BongaTheProto
2024-04-17 18:37:10 -05:00
parent 54bc477175
commit c5f07b2c14
+3 -3
View File
@@ -3996,11 +3996,11 @@ GLOBAL_LIST_EMPTY(preferences_datums)
features["headshot_link"] = null
return
var/static/link_regex = regex("https://i.gyazo.com|https://media.discordapp.net|https://cdn.discordapp.com|https://media.discordapp.net$|https://static1.e621.net") //Do not touch the damn duplicates.
var/static/link_regex = regex("^(https?|ftp):\\/\\/\[^\\s\\/$.?#].\[^\\s]*$") //Do not touch the damn duplicates.
var/static/end_regex = regex(".jpg|.jpg|.png|.jpeg|.jpeg") //Regex is terrible, don't touch the duplicate extensions
if(!findtext(usr_input, link_regex, 1, 29))
to_chat(usr, span_warning("The link needs to be an unshortened Gyazo, E621, or Discordapp link!"))
if(!findtext(usr_input, link_regex))
to_chat(usr, span_warning("You need a valid link!"))
return
if(!findtext(usr_input, end_regex, -8))
to_chat(usr, span_warning("You need either \".png\", \".jpg\", or \".jpeg\" in the link!"))