From 9dfbc51d8d224c8dcefe7fe5c3f66b38b379710a Mon Sep 17 00:00:00 2001 From: Kyle Spier-Swenson Date: Mon, 25 Apr 2022 19:31:45 -0700 Subject: [PATCH] Adds a discord bot command version of show-server-revision (#66338) * Adds a discord bot command version of show-server-revision This is to replace `!tgs revision` with something less lame. * Update chat_commands.dm * Update chat_commands.dm * Update chat_commands.dm * Update chat_commands.dm * remove unneeded sanic --- code/modules/admin/chat_commands.dm | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/code/modules/admin/chat_commands.dm b/code/modules/admin/chat_commands.dm index 98985156910..064892c90d3 100644 --- a/code/modules/admin/chat_commands.dm +++ b/code/modules/admin/chat_commands.dm @@ -20,6 +20,32 @@ var/server = CONFIG_GET(string/server) return "[GLOB.round_id ? "Round #[GLOB.round_id]: " : ""][GLOB.clients.len] players on [SSmapping.config.map_name]; Round [SSticker.HasRoundStarted() ? (SSticker.IsRoundInProgress() ? "Active" : "Finishing") : "Starting"] -- [server ? server : "[world.internet_address]:[world.port]"]" +/datum/tgs_chat_command/gameversion + name = "gameversion" + help_text = "Gets the version details from the show-server-revision verb, basically" + +/datum/tgs_chat_command/gameversion/Run(datum/tgs_chat_user/sender, params) + var/list/msg = list("") + msg += "BYOND Server Version: [world.byond_version].[world.byond_build] (Compiled with: [DM_VERSION].[DM_BUILD])\n" + + if (!GLOB.revdata) + msg += "No revision information found." + else + msg += "Revision [copytext_char(GLOB.revdata.commit, 1, 9)]" + if (GLOB.revdata.date) + msg += " compiled on '[GLOB.revdata.date]'" + + if(GLOB.revdata.originmastercommit) + msg += ", from origin commit: <[CONFIG_GET(string/githuburl)]/commit/[GLOB.revdata.originmastercommit]>" + + if(GLOB.revdata.testmerge.len) + msg += "\n" + for(var/datum/tgs_revision_information/test_merge/PR as anything in GLOB.revdata.testmerge) + msg += "PR #[PR.number] at [copytext_char(PR.head_commit, 1, 9)] [PR.title].\n" + if (PR.url) + msg += "<[PR.url]>\n" + return msg.Join("") + /datum/tgs_chat_command/ahelp name = "ahelp" help_text = " |list>>"