Sends an in-game notification when a player is kicked/banned from a game of Garry's Mod TTT for having too low karma.
TTT Karma configuration options
Discord blocks requests from Garry's Mod clients/servers using the built-in HTTP capabilities.
You must the CHTTP Lua module (recommended) or use a proxy HTTP server (hard).
- Go to https://github.com/timschumi/gmod-chttp/releases
- Download the correct version
- If you are running on a Windows server, on the 32-bit Gmod branch (currently the default branch for servers)
- Download
gmsv_chttp_win32.dll
- Download
- If you are running on a Windows server, on the x86-64 Gmod branch
- Download
gmsv_chttp_win64.dll
- Download
- If you are running on a Linux server, on the 32-bit Gmod branch (currently the default branch for servers)
- Download
gmsv_chttp_linux.dll
- Download
- If you are running on a Linux server, on the x86-64 Gmod branch
- Download
gmsv_chttp_linux64.dll
- Download
- If you are running on a Windows server, on the 32-bit Gmod branch (currently the default branch for servers)
- If it does not already exist in your server's files, create the
garrysmod/lua/bin/
folder on your server.- E.g. If your Garry's Mod server is located at
myserver/garrysmod/gameinfo.txt
- Then this folder should be made at
myserver/garrysmod/lua/bin
- E.g. If your Garry's Mod server is located at
- Drop the file you downloaded into this folder
Thanks to GMod Store for this guide.
You must have edit channel permissions
- In Discord, right click on the channel you want notifications to appear in
- Select Edit Channel
- Go to Integrations
- View Webhooks
- New Webhook
- Fill in the information and click "Copy Webhook URL"
The webhook URL should look something like https://discord.com/api/webhooks/700000000123456789/EXAMPLEEXAMPLEEXAMPLE
- Open the file
garrysmod/cfg/server.cfg
on your server. - Add the line -
ttt_karmakick_discordwebhookurl "https://discord.com/api/webhooks/700000000123456789/EXAMPLEEXAMPLEEXAMPLE"
- Replace
https://discord.com/api/webhooks/700000000123456789/EXAMPLEEXAMPLEEXAMPLE
with the Discord Webhook URL in step 2.
If you don't want to use the CHTTP module, you can proxy your Discord notifications through a website.
GMod server => Website => Discord API
This requires some experience with creating web services.
In garrysmod/cfg/server.cfg
, set the ttt_dmglogs_discordurl
to your proxy website URL.
E.g.
ttt_dmglogs_discordurl "https://example.com/report-notifications"
To debug, add the following lines to lua/autorun/server/karma_kick_notification.lua
hook.Remove("PlayerSay", "KarmaKickNotif_PlayerSay")
hook.Add("PlayerSay", "KarmaKickNotif_PlayerSay", function(ply, text, team)
if(string.lower(text) != "!kkick") then return end
KarmaKickNotification.SendNotification(ply)
return false
end)