Garry's Mod

Garry's Mod

Not enough ratings
[TTT] Customizable Discord Muting/Deafening
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Server content
Addon Tags: Fun, Realism
File Size
Posted
Updated
19.469 KB
8 Mar, 2023 @ 8:26am
25 May, 2023 @ 9:38am
2 Change Notes ( view )

Subscribe to download
[TTT] Customizable Discord Muting/Deafening

Description
Automatic Discord muting/deafening when configurable TTT events happen.
This addon is highly customizable and can replicate the behavior of other TTT discord addons while being easier to set up.

Setup
  1. Install https://github.com/timschumi/gmod-chttp on the server.
  2. Create a discord bot, add it to your server and give it permission to deafen and mute members.
  3. Set discord_token to your bot's token.
  4. Set discord_guild to your discord server ID[support.discord.com].
  5. Configure the ConVars to your liking (the default values won't do anything).

Example Configurations
Mute on Death
Mute dead players for 10 seconds. Leave discord_dead_duration at 0 to mute them until the end of the round.
discord_dead_mute 1 discord_dead_duration 10
Deaf while Alive
Alive players are deafened while in an active round. Works great alongside a proximity voice chat addon such as this one.
discord_alive_deaf 1

Discord User IDs
We need to know every player's discord user ID[support.discord.com]:
Players can type !discord DISCORD_ID to set their own Discord account.

Superadmins can type !discord DISCORD_ID PLAYER_NAME to set other players' Discord accounts for them.
You could also just manually edit garrysmod/data/discord_player_map.json and insert the steamID[www.steamidfinder.com] → discord user ID mappings as JSON:
{ "STEAM_0:0:12345678": "12345678912345678", "STEAM_0:0:12345679": "12345678912345679" }

All ConVars
ConVar
Default
Description
discord_enable
1
Enable / disable the bot
discord_token
Set the bot token
discord_guild
Set the guild the bot is in
discord_mute_icon_enabled
1
Should muted players have a mute icon in the top right of their screen?
discord_alive_mute
nil
Alive players are muted? (1 = true, 0 = false, "nil" = no override)
discord_alive_deaf
nil
Alive players are deaf? (1 = true, 0 = false, "nil" = no override)
discord_dead_mute
nil
Dead players are muted? (1 = true, 0 = false, "nil" = no override)
discord_dead_deaf
nil
Dead players are deaf? (1 = true, 0 = false, "nil" = no override)
discord_dead_duration
0
How long should the death voice state be applied for in seconds? (0 = unlimited)
discord_ttt_inactive_mute
0
Overrides mute state of everyone when not an active round (1 = true, 0 = false, "nil" = no override)
discord_ttt_inactive_deaf
0
Overrides deaf state of everyone when not an active round (1 = true, 0 = false, "nil" = no override)
discord_ttt_preparing_active
0
Treat TTT preparing as active?
discord_ttt_postround_active
0
Treat TTT postround as active?

Commands
discord_pause
Pause/Unpause the addon. Pausing will temporarily unmute and undeafen everyone.


For more information, see the GitHub: https://github.com/ruby0b/ttt-discord-bot
5 Comments
zugiツ 20 Aug, 2023 @ 4:06pm 
hey ich probiere schon seit tagen dein addon auf meinen server zu benutzen und vor monaten, hat das auf einem anderen server noch gut geklappt, aber es will irgendwie nicht mehr gehen. ich hab mehrmals die anleitungen gelesen und befolgt aber es will nicht mehr. kannst du mir da helfen
Torque 25 May, 2023 @ 10:03am 
Thxs
ruby0b  [author] 25 May, 2023 @ 9:48am 
I just added a !discord chat command that allows players to set their own Discord IDs (see the updated description) so you no longer have to enter them yourself.

(You can forbid players from setting their own Discord IDs by taking away their discord_manage ULib permission.)
Torque 21 May, 2023 @ 2:14pm 
Do you have to put in the ids for every person who joins?
Confector 8 Mar, 2023 @ 2:41pm 
10/10