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:
parent
0af5cedb2b
commit
d108d9a99b
@ -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
|
||||
|
@ -9,6 +9,8 @@ Discord = {
|
||||
|
||||
["botPrefix"] = "!",
|
||||
|
||||
["srvStarted"] = true,
|
||||
|
||||
-- For developers (logs)
|
||||
['debug'] = false,
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user