Garry's Mod
Недостатньо оцінок
Garry's Mod Discord Bot
   
Нагородити
До улюбленого
В улюблених
Прибрати
Content Type: Addon
Addon Type: ServerContent
Addon Tags: Roleplay, Realism
Розмір файлу
Додано
Оновлено
23.302 KB
8 листоп. 2019 о 4:50
3 січ. 2022 о 13:51
Змін 18 ( перегляд )

Підпишіться, аби завантажити
Garry's Mod Discord Bot

Опис
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".
Популярні обговорення Переглянути всі (2)
17
16 серп. 2020 о 14:51
ЗАКРІПЛЕНО: Tech Support, Installation Help, etc.
timschumi
5
13 трав. 2020 о 5:09
Discord Bot offline & ingame keine Bestätigung auf !discord
Pittiplatsch
Коментарів: 7
timschumi  [автор] 24 лют. 2023 о 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 лют. 2023 о 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 квіт. 2020 о 15:24 
Ohne ist TTT unspielbar, weil jeder meint er könnte noch kurz einen namen schreien
Chriss 12 квіт. 2020 о 7:34 
Ehren Bot
Fummo 13 січ. 2020 о 15:14 
Very Epic
Inujin 6 груд. 2019 о 4:25 
Nice Addon funktioniert
Erelut4ble 13 листоп. 2019 о 11:08 
Nice:steambored: