<commit_before>#define IRC_STATUS_THROTTLE 5

/datum/server_tools_command/ircstatus
	name = "status"
	help_text = "Gets the admincount, playercount, gamemode, and true game mode of the server"
	admin_only = TRUE
	var/static/last_irc_status = 0

/datum/server_tools_command/ircstatus/Run(sender, params)
	var/rtod = REALTIMEOFDAY
	if(rtod - last_irc_status < IRC_STATUS_THROTTLE)
		return
	last_irc_status = rtod
	var/list/adm = get_admin_counts()
	var/list/allmins = adm["total"]
	var/status = "Admins: [allmins.len] (Active: [english_list(adm["present"])] AFK: [english_list(adm["afk"])] Stealth: [english_list(adm["stealth"])] Skipped: [english_list(adm["noflags"])]). "
	status += "Players: [GLOB.clients.len] (Active: [get_active_player_count(0,1,0)]). Mode: [SSticker.mode ? SSticker.mode.name : "Not started"]."
	return status

/datum/server_tools_command/irccheck
	name = "check"
	help_text = "Gets the playercount, gamemode, and address of the server"
	var/static/last_irc_check = 0

/datum/server_tools_command/irccheck/Run(sender, params)
	var/rtod = REALTIMEOFDAY
	if(rtod - last_irc_check < IRC_STATUS_THROTTLE)
		return
	last_irc_check = rtod
	var/server = CONFIG_GET(string/server)
	return "[GLOB.round_id ? "Round #[GLOB.round_id]: " : ""][GLOB.clients.len] players on [SSmapping.config.map_name], Mode: [GLOB.master_mode]; Round [SSticker.HasRoundStarted() ? (SSticker.IsRoundInProgress() ? "Active" : "Finishing") : "Starting"] -- [server ? server : "[world.internet_address]:[world.port]"]" 

/datum/server_tools_command/ahelp
	name = "ahelp"
	help_text = "<ckey|ticket #> <message|ticket <close|resolve|icissue|reject|reopen <ticket #>|list>>"
	required_parameters = 2
	admin_only = TRUE

/datum/server_tools_command/ahelp/Run(sender, params)
	var/list/all_params = splittext(params, " ")
	var/target = all_params[1]
	all_params.Cut(1, 2)
	var/id = text2num(target)
	if(id != null)
		var/datum/admin_help/AH = GLOB.ahelp_tickets.TicketByID(id)
		if(AH)
			target = AH.initiator_ckey
		else
			return "Ticket #[id] not found!"
	return IrcPm(target, all_params.Join(" "), sender)

/datum/server_tools_command/namecheck
	name = "namecheck"
	help_text = "Returns info on the specified target"
	required_parameters = 1
	admin_only = TRUE

/datum/server_tools_command/namecheck/Run(sender, params)
	log_admin("Chat Name Check: [sender] on [params]")
	message_admins("Name checking [params] from [sender]")
	return keywords_lookup(params, 1)

/datum/server_tools_command/adminwho
	name = "adminwho"
	help_text = "Lists administrators currently on the server"
	admin_only = TRUE

/datum/server_tools_command/adminwho/Run(sender, params)<commit_msg>ahelp chat command is silent on success<commit_after>#define IRC_STATUS_THROTTLE 5

/datum/server_tools_command/ircstatus
	name = "status"
	help_text = "Gets the admincount, playercount, gamemode, and true game mode of the server"
	admin_only = TRUE
	var/static/last_irc_status = 0

/datum/server_tools_command/ircstatus/Run(sender, params)
	var/rtod = REALTIMEOFDAY
	if(rtod - last_irc_status < IRC_STATUS_THROTTLE)
		return
	last_irc_status = rtod
	var/list/adm = get_admin_counts()
	var/list/allmins = adm["total"]
	var/status = "Admins: [allmins.len] (Active: [english_list(adm["present"])] AFK: [english_list(adm["afk"])] Stealth: [english_list(adm["stealth"])] Skipped: [english_list(adm["noflags"])]). "
	status += "Players: [GLOB.clients.len] (Active: [get_active_player_count(0,1,0)]). Mode: [SSticker.mode ? SSticker.mode.name : "Not started"]."
	return status

/datum/server_tools_command/irccheck
	name = "check"
	help_text = "Gets the playercount, gamemode, and address of the server"
	var/static/last_irc_check = 0

/datum/server_tools_command/irccheck/Run(sender, params)
	var/rtod = REALTIMEOFDAY
	if(rtod - last_irc_check < IRC_STATUS_THROTTLE)
		return
	last_irc_check = rtod
	var/server = CONFIG_GET(string/server)
	return "[GLOB.round_id ? "Round #[GLOB.round_id]: " : ""][GLOB.clients.len] players on [SSmapping.config.map_name], Mode: [GLOB.master_mode]; Round [SSticker.HasRoundStarted() ? (SSticker.IsRoundInProgress() ? "Active" : "Finishing") : "Starting"] -- [server ? server : "[world.internet_address]:[world.port]"]" 

/datum/server_tools_command/ahelp
	name = "ahelp"
	help_text = "<ckey|ticket #> <message|ticket <close|resolve|icissue|reject|reopen <ticket #>|list>>"
	required_parameters = 2
	admin_only = TRUE

/datum/server_tools_command/ahelp/Run(sender, params)
	var/list/all_params = splittext(params, " ")
	var/target = all_params[1]
	all_params.Cut(1, 2)
	var/id = text2num(target)
	if(id != null)
		var/datum/admin_help/AH = GLOB.ahelp_tickets.TicketByID(id)
		if(AH)
			target = AH.initiator_ckey
		else
			return "Ticket #[id] not found!"
	var/res = IrcPm(target, all_params.Join(" "), sender)
	if(res != "Message Successful")
		return res

/datum/server_tools_command/namecheck
	name = "namecheck"
	help_text = "Returns info on the specified target"
	required_parameters = 1
	admin_only = TRUE

/datum/server_tools_command/namecheck/Run(sender, params)
	log_admin("Chat Name Check: [sender] on [params]")
	message_admins("Name checking [params] from [sender]")
	return keywords_lookup(params, 1)

/datum/server_tools_command/adminwho
	name = "adminwho"
	help_text = "Lists administrators currently on the server"
	admin_only = TRUE

/datum/server_tools_command/adminwho/Run(sender, params)
{'fraction_non_alphanumeric': 0.1357315038012238, 'fraction_numerical': 0.0048210643426664194, 'mean_word_length': 5.6923076923076925, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1062392', 'n_tokens_mistral': 2107, 'n_tokens_neox': 2010, 'n_words': 390}