Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 452bb80

Browse files
committed
Fixes discord mentor messages not being logged in database or mentor tickets
1 parent ef0102e commit 452bb80

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

yogstation/code/datums/world_topic.dm

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,16 @@ GLOBAL_VAR_INIT(mentornoot, FALSE)
8686
SEND_SOUND(C, sound('sound/misc/nootnoot.ogg'))
8787
else
8888
SEND_SOUND(C, sound('sound/items/bikehorn.ogg'))
89+
var/datum/DBQuery/add_mhelp_query = SSdbcore.NewQuery(
90+
"INSERT INTO `[format_table_name("mentor_interactions")]` (round_id, ckey, ckey_mentor, target_ckey, target_mentor, message) VALUES (:round, :send, :smentor, :receive, :rmentor, :msg);",
91+
list("round" = GLOB.round_id, "send" = from, "smentor" = TRUE, "receive" = C.ckey, "rmentor" = C.is_mentor(), "msg" = msg)
92+
)
93+
if(!add_mhelp_query.Execute())
94+
message_admins("Failed insert mhelp into mhelp DB. Check the SQL error logs for more details.")
95+
qdel(add_mhelp_query)
96+
if(ckey in SSYogs.mentortickets)
97+
var/datum/mentorticket/T = SSYogs.mentortickets[ckey]
98+
T.log += "<b>[from]:</b> [msg]"
8999
to_chat(C, "<font color='purple'>Mentor PM from-<b>[discord_mentor_link(from, from_id)]</b>: [msg]</font>", confidential = TRUE)
90100
var/show_char_recip = !C.is_mentor() && CONFIG_GET(flag/mentors_mobname_only)
91101
for(var/client/X in GLOB.mentors | GLOB.permissions.admins)

0 commit comments

Comments
 (0)