Bot cleanup and config

Cleaning my code up and adding stuff to config
This commit is contained in:
Cadyn
2021-02-24 16:05:49 -08:00
parent 155195e892
commit 3995353b03
6 changed files with 87 additions and 21 deletions
+21 -5
View File
@@ -54,6 +54,8 @@
* Call the chat webhook to transmit a notification of an admin fax to the admin chat.
*/
/obj/machinery/photocopier/faxmachine/proc/message_chat_admins(var/mob/sender, var/faxname, var/obj/item/sent, var/faxid, font_colour="#006100")
if(config.discord_faxes_disabled) //CHOMPEdit
return
if (config.chat_webhook_url)
spawn(0)
var/query_string = "type=fax"
@@ -70,12 +72,26 @@
var/obj/item/weapon/paper_bundle/B = sent
faxid = copytext(faxid,1,idlen-2)
var/faxids = "FAXMULTIID: [faxid]_0"
for(var/page = 1, page <= B.pages.len, page++)
faxids+= "|[faxid]_[page]"
world.TgsTargetedChatBroadcast("MULTIFAX: [sanitize(faxname)] / [sanitize(sent.name)] - SENT BY: [sanitize(sender.name)] - [faxids]", TRUE)
var/contents = ""
world.TgsTargetedChatBroadcast("FAX: [sanitize(faxname)] / [sanitize(sent.name)] - SENT BY: [sanitize(sender.name)] - FAXID: **[sanitize(faxid)]**", TRUE)
if((!config.nodebot_enabled) && config.discord_faxes_autoprint)
var/faxmsg = return_file_text("[config.fax_export_dir]/fax_[faxid]_0.html")
contents += "\nFAX: ```[strip_html_properly(faxmsg)]```"
for(var/page = 1, page <= B.pages.len, page++)
var/curid = "[faxid]_[page]"
faxids+= "|[curid]"
if((!config.nodebot_enabled) && config.discord_faxes_autoprint)
var/faxmsg = return_file_text("[config.fax_export_dir]/fax_[curid].html")
contents += "\nFAX PAGE [page]: ```[strip_html_properly(faxmsg)]```"
world.TgsTargetedChatBroadcast("MULTIFAX: [sanitize(faxname)] / [sanitize(sent.name)] - SENT BY: [sanitize(sender.name)] - [faxids] [contents]", TRUE)
else
var/contents = ""
if((!config.nodebot_enabled) && config.discord_faxes_autoprint)
var/faxmsg = return_file_text("[config.fax_export_dir]/fax_[faxid].html")
contents += "\nFAX: ```[strip_html_properly(faxmsg)]```"
world.TgsTargetedChatBroadcast("FAX: [sanitize(faxname)] / [sanitize(sent.name)] - SENT BY: [sanitize(sender.name)] - FAXID: **[sanitize(faxid)]** [contents]", TRUE)
//YW EDIT END
//
+2 -2
View File
@@ -368,8 +368,8 @@
t = replacetext(t, "\[/grid\]", "</td></tr></table>")
t = replacetext(t, "\[row\]", "</td><tr>")
t = replacetext(t, "\[cell\]", "<td>")
t = replacetext(t, "\[logo\]", "<img src = ntlogo.png>")
t = replacetext(t, "\[sglogo\]", "<img src = sglogo.png>")
t = replacetext(t, "\[logo\]", "<img src = https://raw.githubusercontent.com/CHOMPStation2/CHOMPStation2/master/html/images/ntlogo.png>") //CHOMPEdit
t = replacetext(t, "\[sglogo\]", "<img src = https://raw.githubusercontent.com/CHOMPStation2/CHOMPStation2/master/html/images/sglogo.png>") //CHOMPEdit
t = "<font face=\"[deffont]\" color=[P ? P.colour : "black"]>[t]</font>"
else // If it is a crayon, and he still tries to use these, make them empty!