//This is a list of words which are ignored by the parser when comparing message contents for names. MUST BE IN LOWER CASE! var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","alien","as") /client/verb/adminhelp(msg as text) set category = "Admin" set name = "Adminhelp" if(say_disabled) //This is here to try to identify lag problems usr << "Speech is currently admin-disabled." return //handle muting and automuting if(prefs.muted & MUTE_ADMINHELP) src << "Error: Admin-PM: You cannot send adminhelps (Muted)." return adminhelped = 2 //Determines if they get the message to reply by clicking the name. /*A wee bit of an update here: we're using the following table for adminhelped values: 3 - Adminhelp has not been claimed and was sent to discord as well. 2 - Adminhelp has not been claimed by anyone. 1 - Adminhelp has been claimed, initial message has not been sent. 0 - Adminhelp has been claimed, initial message has been sent. */ if(src.handle_spam_prevention(msg,MUTE_ADMINHELP)) return //clean the input msg if(!msg) return msg = sanitize(msg) if(!msg) return var/original_msg = msg //explode the input msg into a list var/list/msglist = text2list(msg, " ") //generate keywords lookup var/list/surnames = list() var/list/forenames = list() var/list/ckeys = list() for(var/mob/M in mob_list) var/list/indexing = list(M.real_name, M.name) if(M.mind) indexing += M.mind.name for(var/string in indexing) var/list/L = text2list(string, " ") var/surname_found = 0 //surnames for(var/i=L.len, i>=1, i--) var/word = ckey(L[i]) if(word) surnames[word] = M surname_found = i break //forenames for(var/i=1, iPM to-Staff : [original_msg]" var/admin_number_active = admin_number_present - admin_number_afk log_admin("HELP: [key_name(src)]: [original_msg] - heard by [admin_number_present] non-AFK admins.",admin_key=key_name(src)) if(admin_number_active <= 0) post_webhook_event(WEBHOOK_ADMIN_PM_IMPORTANT, list("title"="Help is requested", "message"="Request for Help from **[key_name(src)]**: ```[html_decode(original_msg)]```\n[admin_number_afk ? "All admins AFK ([admin_number_afk])" : "No admins online"]!!")) discord_bot.send_to_admins("@here Request for Help from [key_name(src)]: [html_decode(original_msg)] - !![admin_number_afk ? "All admins AFK ([admin_number_afk])" : "No admins online"]!!") adminhelped = 3 feedback_add_details("admin_verb","AH") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! return