Garry's Mod
Evaluări insuficiente
Garry's Mod Discord Bot
   
Premiază
Adaugă la preferate
Preferat
Elimină din preferate
Content Type: Addon
Addon Type: ServerContent
Addon Tags: Roleplay, Realism
Dimensiunea fișierului
Postat
Actualizat
23.302 KB
8 nov. 2019 la 4:50
3 ian. 2022 la 13:51
18 jurnale de actualizare ( vizionare )

Abonează-te pentru a descărca
Garry's Mod Discord Bot

Descriere
This is a Discord bot for Garry's Mod that directly interfaces with the Discord API. It automatically mutes players when they die in-game and unmutes them when revived.

Please don't ask for help in the comments or via PM, there is a Discord support server[discord.gg] or a Steam Workshop discussion for that. I will not accept any friend requests from people I don't know. I reserve my right to ignore (and occasionally clean up) support questions in the comments, since the feature is simply unfit for that purpose.

The plugin doesn't work fully standalone right now, since direct HTTP accesses to the Discord API from the GMod User-Agent are disallowed. You will either need an utility that proxies requests with a custom User-Agent or through a custom HTTP library that allows for changing the User-Agent.

One possible custom HTTP module is CHTTP (visit it on GitHub[github.com]), which will be used automatically if it is installed.

If the proxy-method is more desirable, you can change the API URL through the `discord_api` console variable. Please note that the server that you put there will receive your whole request, including the Bot token.

Additionally, this plugin needs a support library, which is available on the workshop as well.

Caveats
  • Since the Discord developers aren't particularly fond of GMod interfacing with the Discord API, I built in a failsafe to not get on their nerves. It will shut down all HTTP requests if an unexpected error is encountered. Exceptions for non-fatal issues will be added over time.

  • This plugin does not have a channel filter. It will mute/unmute people no matter which channel they are in (as long as they are on the Garry's Mod server). This could be restricted by allowing the bot permissions by-channel, but a "permission denied" error can cause the failsafe to activate.

  • The bot does not have player verification. A player can put in the Tag of any User on the server when connecting his Steam account.

Setup

I created a guide that describes the setup process in detail (it even has pictures!).

If you don't want to setup C.H.T.T.P.[github.com] but have a Discord API proxy, you can adjust the URL in the `discord_api` variable. It will send all requests to that URL instead.

Credits
marceltransier (GitHub[github.com], Steam) for the original plugin/bot combo[github.com] that this is based on (although heavily deviated by now).

Contribute
The project is open-source and available on GitHub[github.com]. If you can think of a feature (or even a tiny improvement), I'd love it if you could open an issue or a Pull Request (especially if it's about a better icon, even if that's hardly possible with my immaculate graphic design skills).

Issue reports are totally fine as well of course, even if it's about compatibility with other addons. The worst thing that can happen is that I'll close the bug report with a notice of "has to be fixed on the other end".
Discuții populare Vezi toate (2)
17
16 aug. 2020 la 14:51
IMPORTANT: Tech Support, Installation Help, etc.
timschumi
5
13 mai 2020 la 5:09
Discord Bot offline & ingame keine Bestätigung auf !discord
Pittiplatsch
7 comentarii
timschumi  [autor] 24 febr. 2023 la 11:22 
Die entsprechenden Endpoints sind alle im Discord Developer Portal dokumentiert, so zum Beispiel auch der Endpoint zum ändern von Servermitgliedern: https://discord.com/developers/docs/resources/guild#modify-guild-member
Menzek 23 febr. 2023 la 11:22 
Super Addon!
Du nutzt requests um z.B. Spieler zu muten.

request("PATCH", "/guilds/"..cvar_guild:GetString().."/members/"..self:getDiscordID(), function(code, body, headers)

Woher weißt du wie du den request addressieren musst? In der Discord-Doku hab ich bislang nichts dazu gefunden ...
Tony Sparrow-Hawk 13 apr. 2020 la 15:24 
Ohne ist TTT unspielbar, weil jeder meint er könnte noch kurz einen namen schreien
Chriss 12 apr. 2020 la 7:34 
Ehren Bot
Fummo 13 ian. 2020 la 15:14 
Very Epic
Inujin 6 dec. 2019 la 4:25 
Nice Addon funktioniert
Erelut4ble 13 nov. 2019 la 11:08 
Nice:steambored: