1
0
mirror of https://github.com/troit5ky/gmod_discord_relay.git synced 2025-03-04 03:03:15 -05:00

add srvStarted config option to toggle server startup messages

useful for servers that have constant restarts that do not want relay channel pollution.
This commit is contained in:
edshot99 2024-02-15 01:44:24 -06:00
parent 0af5cedb2b
commit d108d9a99b
2 changed files with 6 additions and 1 deletions

View File

@ -171,6 +171,8 @@ hook.Add("player_connect", "!!discord_plyConnect", playerConnect)
hook.Add("PlayerInitialSpawn", "!!discordPlyFrstSpawn", plyFrstSpawn)
gameevent.Listen( "player_disconnect" )
hook.Add("player_disconnect", "!!discord_onDisconnect", plyDisconnect)
if Discord.srvStarted then
hook.Add("Initialize", "!!discord_srvStarted", function()
local form = {
["username"] = Discord.hookname,
@ -183,4 +185,5 @@ hook.Add("Initialize", "!!discord_srvStarted", function()
Discord.send(form)
hook.Remove("Initialize", "!!discord_srvStarted")
end)
end)
end

View File

@ -9,6 +9,8 @@ Discord = {
["botPrefix"] = "!",
["srvStarted"] = true,
-- For developers (logs)
['debug'] = false,