Files
Bubberstation/code/modules/admin/verbs/adminsay.dm
SkyratBot 84e42fd0eb [MIRROR] Removes some code soul (IF YOU ARE COPY PASTING THIS...), replaces it with a macro [MDB IGNORE] (#25272)
* Removes some code soul (`IF YOU ARE COPY PASTING THIS...`), replaces it with a macro (#79935)

## About The Pull Request

Replaces all instances of `SSblackbox.record_feedback\("tally",
"admin_verb", 1, (.+)\)` with `BLACKBOX_LOG_ADMIN_VERB($1)`

This makes so the funny comment isn't necessary.

It also reveals one location which someone did not heed the comment, the
`debug_controller` proc copy+pasted the line but did not change the
fourth argument. PEOPLE DON'T READ!

* Removes some code soul (`IF YOU ARE COPY PASTING THIS...`), replaces it with a macro

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
2023-11-27 01:02:37 -05:00

41 lines
1.6 KiB
Plaintext

/client/proc/cmd_admin_say(msg as text)
set category = "Admin"
set name = "Asay" //Gave this shit a shorter name so you only have to time out "asay" rather than "admin say" to use it --NeoFite
set hidden = TRUE
if(!check_rights(0))
return
msg = emoji_parse(copytext_char(sanitize(msg), 1, MAX_MESSAGE_LEN))
if(!msg)
return
if(findtext(msg, "@") || findtext(msg, "#"))
var/list/link_results = check_asay_links(msg)
if(length(link_results))
msg = link_results[ASAY_LINK_NEW_MESSAGE_INDEX]
link_results[ASAY_LINK_NEW_MESSAGE_INDEX] = null
var/list/pinged_admin_clients = link_results[ASAY_LINK_PINGED_ADMINS_INDEX]
for(var/iter_ckey in pinged_admin_clients)
var/client/iter_admin_client = pinged_admin_clients[iter_ckey]
if(!iter_admin_client?.holder)
continue
window_flash(iter_admin_client)
SEND_SOUND(iter_admin_client.mob, sound('sound/misc/asay_ping.ogg'))
mob.log_talk(msg, LOG_ASAY)
msg = keywords_lookup(msg)
send_asay_to_other_server(ckey, msg) //SKYRAT EDIT ADDITION
var/asay_color = prefs.read_preference(/datum/preference/color/asay_color)
var/custom_asay_color = (CONFIG_GET(flag/allow_admin_asaycolor) && asay_color) ? "<font color=[asay_color]>" : "<font color='[DEFAULT_ASAY_COLOR]'>"
msg = "[span_adminsay("[span_prefix("ADMIN:")] <EM>[key_name(usr, 1)]</EM> [ADMIN_FLW(mob)]: [custom_asay_color]<span class='message linkify'>[msg]")]</span>[custom_asay_color ? "</font>":null]"
to_chat(GLOB.admins,
type = MESSAGE_TYPE_ADMINCHAT,
html = msg,
confidential = TRUE)
BLACKBOX_LOG_ADMIN_VERB("Asay")
/client/proc/get_admin_say()
var/msg = input(src, null, "asay \"text\"") as text|null
cmd_admin_say(msg)