Garry's Mod

Garry's Mod

Not enough ratings
Discord Muter v2 (Beta)
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Server content
Addon Tags: Fun, Roleplay, Realism
File Size
Posted
Updated
66.421 KB
20 Jul, 2021 @ 2:44am
28 Aug, 2021 @ 7:28am
7 Change Notes ( view )

Subscribe to download
Discord Muter v2 (Beta)

In 1 collection by Manix84
[TTT] DVWeb Server Content
80 items
Description
This is a public beta. Some features may not work right, but the core mute/deafen functions are working. If you notice anything that's not working, and you expected it to be, please raise an issue at https://github.com/manix84/discord_gmod_addon_v2/issues

Mute players in your Discord server, after they die.

Works for TTT, TTT2, and Murder.

But why?
We all have that friend that likes to shout the name of their killer after they die. It's no fun for anyone involved. This mod lets you cut their mic for a few seconds or, until the round ends. Which-ever suites your team. After about 5-10 seconds, they've usually calmed down and they can re-join to laugh at what's happening.

Version 2 Differences
This version no longer requires you to setup and maintain the Node Bot. I've completely rebuilt the bot from the ground up to be a single entity. You will need to invite the bot into your server, and then setup a link with it. This will allow it to know that your GMod server is asking to mute your players, not some random on the internet. Once a player has setup the link from your server to the bot, they never need to repeat the step. They're linked for any server that uses Discord Muter v2.

Features
  • Works in Trouble in Terrorist Town (and TTT2: Advanced Update), and Murder.
  • Centrally hosted bot. Though, you can download and host the bot yourself, if you want.
  • Secure & Authenticated connection, so no-one should be hijacking your bot communication.
  • Mute a Player for the entire round, or simply for a few seconds.
  • Deafen a Player for the entire round, or simply for a few seconds.
  • ULX Support:
    • Added (Un)Mute and (Un)Deafen in module commands menu.
    • Added Discord Settings

Requirements
You will need to invite the bot to your discord server[discord-muter.herokuapp.com], then ask it for an AuthToken, by typing
!muter setup
. Then you just copy the code into your gmod config, and your server is connected.

ConsoleVariables
(Those variables that live in /garrysmod/cfg/server.cfg

Variable
Optional/Default
Description
Guide
discord_auth_token
!Required!
The Authorisation Token, used for communication with the Discord Node Bot.
discord_server_id
!Required!
The Discord ID for your Server/Guild.
discord_channel_id
!Required!
The Discord ID for your Channel that you'd like to mute.
discord_name
Discord
The prefix displayed to your players when the add-on sends them a message (EG: [<discord_name>] You've been muted until the end of the round.)
-
discord_server_link
The discord invite shown to players when they connect for the first time. (EG: [Discord] Join the discord server - https://discord.gg/yg6KJ8c/)
-
discord_mute_round
1
Should a players be muted until the round ends? (1=Yes, 0=No)
-
discord_mute_duration
5
How many seconds should a player be muted after death? (has no effect if discord_mute_round is enabled)
-
*Please remember to wrap your URL's in quotes, because the // part of the URL will be treated as a comment.

Support
I'm aware that some of this is quite technical, but I'm happy to lend a hand where I can.

This might not solve all of the issues, so I setup a Discord server specifically to help anyone that's struggling. You can join via https://discord.gg/yg6KJ8c. I'm always happy to help, even if it takes me a while to reply.


The Source Code
7 Comments
James 21 Sep, 2022 @ 11:53pm 
Is this still being worked on? A centeralized solution would be perfect for the community, due to the fact of Heroku closing their free servuces (Personally thought that's bs)
PurKus 21 Jul, 2022 @ 3:06pm 
>> [Discord Muter v2 (Beta)] lua/discord/utils/sv_bot.lua:22: attempt to index local 'bodyTable' (a nil value) 1. onsuccess - lua/discord/utils/sv_bot.lua:22 2. unknown - lua/includes/modules/http.lua:58 <<
Liamsawn 17 Jul, 2022 @ 9:13pm 
Hey your bot website has an warning stating: Deceptive site ahead,
Attackers on discord-muter.herokuapp.com may trick you into doing something dangerous like installing software or revealing your personal information (for example, passwords, phone numbers, or credit cards).
Hagen 21 Feb, 2022 @ 5:24pm 
Does sadly not work for me, i have the same error as the commenter below me
SmilinTurd 24 Jan, 2022 @ 4:28am 
Fark, even though you've set it up so easy, im still fucking it up when installing it. Ive invited the bot, did the authentication token, done the server.cfg.

I have an error saying: lua/discord/utils/sv_bot.lua:22 attempt to index local 'bodytable' (a nil value).
1. onsuccess - lua/discord/utils/sv_bot.lua:22
2. unknown - lua/includes/modules/http.lua:58
Manix84  [author] 12 Aug, 2021 @ 3:26am 
That's one of the code options. [code]discord_mute_round[/code] is a boolean flag (meaning 1 is true, and 0 is false), which says mute until the round ends, rather than timed.
InsanitySimulator 9 Aug, 2021 @ 1:14pm 
is it possible to use this mod to make it so that if a player dies in discord they'll be muted until the next round begins?