Garry's Mod
No hay suficientes valoraciones
Garry's Mod Discord Bot
   
Premio
Favoritos
Favorito
Quitar
Content Type: Addon
Addon Type: ServerContent
Addon Tags: Roleplay, Realism
Tamaño
Publicado el
Actualizado el
23.302 KB
8 NOV 2019 a las 4:50 a. m.
3 ENE 2022 a las 1:51 p. m.
18 notas sobre cambios ( ver )

Suscríbete para descargar
Garry's Mod Discord Bot

Descripción
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".
Discusiones populares Ver todo (2)
17
16 AGO 2020 a las 2:51 p. m.
FIJO: Tech Support, Installation Help, etc.
timschumi
5
13 MAY 2020 a las 5:09 a. m.
Discord Bot offline & ingame keine Bestätigung auf !discord
Pittiplatsch
7 comentarios
timschumi  [autor] 24 FEB 2023 a las 11:22 a. m. 
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 FEB 2023 a las 11:22 a. m. 
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 ABR 2020 a las 3:24 p. m. 
Ohne ist TTT unspielbar, weil jeder meint er könnte noch kurz einen namen schreien
Chriss 12 ABR 2020 a las 7:34 a. m. 
Ehren Bot
Fummo 13 ENE 2020 a las 3:14 p. m. 
Very Epic
Inujin 6 DIC 2019 a las 4:25 a. m. 
Nice Addon funktioniert
Erelut4ble 13 NOV 2019 a las 11:08 a. m. 
Nice:steambored: