mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Bot cleanup and config
Cleaning my code up and adding stuff to config
This commit is contained in:
@@ -1,12 +1,25 @@
|
||||
/client/var/datum/admin_help/current_ticket //the current ticket the (usually) not-admin client is dealing with
|
||||
|
||||
//CHOMPEdit Begin
|
||||
/proc/get_ahelp_channel()
|
||||
var/datum/tgs_api/v5/api = TGS_READ_GLOBAL(tgs)
|
||||
if(istype(api))
|
||||
if(istype(api) && config.ahelp_channel_tag)
|
||||
for(var/datum/tgs_chat_channel/channel in api.chat_channels)
|
||||
if(channel.custom_tag == "ahelps")
|
||||
if(channel.custom_tag == config.ahelp_channel_tag)
|
||||
return list(channel)
|
||||
//
|
||||
return 0
|
||||
|
||||
/proc/ahelp_discord_message(var/message)
|
||||
if(!message)
|
||||
return
|
||||
if(config.discord_ahelps_disabled)
|
||||
return
|
||||
var/datum/tgs_chat_channel/ahelp_channel = get_ahelp_channel()
|
||||
if(ahelp_channel)
|
||||
world.TgsChatBroadcast(message,ahelp_channel)
|
||||
else
|
||||
world.TgsTargetedChatBroadcast(message,TRUE)
|
||||
//CHOMPEdit End
|
||||
//TICKET MANAGER
|
||||
//
|
||||
|
||||
@@ -196,9 +209,9 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
|
||||
var/list/activemins = adm["present"]
|
||||
var activeMins = activemins.len
|
||||
if(is_bwoink)
|
||||
world.TgsChatBroadcast("ADMINHELP: FROM: [key_name_admin(usr)] TO [initiator_ckey]/[initiator_key_name] - MSG: **[msg]** - Heard by [activeMins] NON-AFK staff members.", get_ahelp_channel()) //CHOMPEdit
|
||||
ahelp_discord_message("ADMINHELP: FROM: [key_name_admin(usr)] TO [initiator_ckey]/[initiator_key_name] - MSG: **[msg]** - Heard by [activeMins] NON-AFK staff members.") //CHOMPEdit
|
||||
else
|
||||
world.TgsChatBroadcast("ADMINHELP: FROM: [initiator_ckey]/[initiator_key_name] - MSG: **[msg]** - Heard by [activeMins] NON-AFK staff members.", get_ahelp_channel()) //CHOMPEdit
|
||||
ahelp_discord_message("ADMINHELP: FROM: [initiator_ckey]/[initiator_key_name] - MSG: **[msg]** - Heard by [activeMins] NON-AFK staff members.") //CHOMPEdit
|
||||
//YW EDIT END
|
||||
GLOB.ahelp_tickets.active_tickets += src
|
||||
|
||||
@@ -210,7 +223,8 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
|
||||
|
||||
/datum/admin_help/proc/AddInteraction(formatted_message)
|
||||
var/curinteraction = "[gameTimestamp()]: [formatted_message]"
|
||||
world.TgsChatBroadcast("ADMINHELP: TICKETID:[id] [strip_html_properly(curinteraction)]", get_ahelp_channel()) //CHOMPEdit
|
||||
if(config.discord_ahelps_all) //CHOMPEdit
|
||||
ahelp_discord_message("ADMINHELP: TICKETID:[id] [strip_html_properly(curinteraction)]") //CHOMPEdit
|
||||
_interactions += curinteraction
|
||||
|
||||
//private
|
||||
|
||||
Reference in New Issue
Block a user