Files
Bubberstation/code/modules/discord/tgs_commands.dm
SkyratBot 2a89a9f3af [MIRROR] Implement TGS DMAPI 6.1.0 features [MDB IGNORE] (#20201)
* Implement TGS DMAPI 6.1.0 features

* Update ticker.dm

* E

* Revert "E"

This reverts commit 23e33ae17d0a2ff58063940ca7c115113c0a02aa.

---------

Co-authored-by: Jordan Dominion <Cyberboss@users.noreply.github.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
2023-03-31 14:50:32 +01:00

52 lines
2.3 KiB
Plaintext

/datum/tgs_chat_command/tgscheck
name = "check"
help_text = "Gets the playercount, gamemode, and address of the server"
/datum/tgs_chat_command/tgscheck/Run(datum/tgs_chat_user/sender, params)
var/server = CONFIG_GET(string/server)
return new /datum/tgs_message_content("[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 new /datum/tgs_message_content(msg.Join(""))
// Notify
/datum/tgs_chat_command/notify
name = "notify"
help_text = "Pings the invoker when the round ends"
/datum/tgs_chat_command/notify/Run(datum/tgs_chat_user/sender, params)
if(!CONFIG_GET(string/channel_announce_new_game))
return new /datum/tgs_message_content("Notifcations are currently disabled")
for(var/member in SSdiscord.notify_members) // If they are in the list, take them out
if(member == sender.mention)
SSdiscord.notify_members -= sender.mention
return new /datum/tgs_message_content("You will no longer be notified when the server restarts")
// If we got here, they arent in the list. Chuck 'em in!
SSdiscord.notify_members += sender.mention
return new /datum/tgs_message_content("You will now be notified when the server restarts")