Garry's Mod

Garry's Mod

Garry's Mod Discord Bot
 This topic has been pinned, so it's probably important
timschumi  [developer] Nov 20, 2019 @ 11:15am
Tech Support, Installation Help, etc.
Well, what the title says.

If you are posting here, please include the following information:
  • OS
  • Using CHTTP/STEAMHTTP (or not)
Last edited by timschumi; Jan 14, 2020 @ 5:04am
< >
Showing 1-15 of 17 comments
Spudmonkey Nov 20, 2019 @ 3:38pm 
Reposting my issue like you asked:

Hi, I get the following errors: 'Got an HTTP error code that is neither 200, nor 403: 401' when trying to use the !discord command, and

[Discord] [ERROR] HTTP error during request
[Discord] [ERROR] method: GET
[Discord] [ERROR] endpoint: '/guilds/142757984487866368/members?limit=20'
[Discord] [ERROR] err: Couldn't resolve host name

when I changed the discord_api to h.t.t.p.s discordapp.com/api
Spudmonkey Nov 20, 2019 @ 3:39pm 
I'll try putting quotes around the API and having a look at the token. Is the token the bot secret or is it the bot token?
timschumi  [developer] Nov 20, 2019 @ 3:58pm 
The Token is the "Bot Token" (found in the Bot tab), not the "Client Secret".
Last edited by timschumi; Nov 20, 2019 @ 4:00pm
Spudmonkey Nov 20, 2019 @ 4:50pm 
I re-downloaded the gmod addon from your github page, set the discord bot token, my discord guild ID and left the discord api setting alone in the in-game console, but I still get the error

[Discord] [ERROR] HTTP error during request
[Discord] [ERROR] method: GET
[Discord] [ERROR] endpoint: '/guilds/142757984487866368/members?limit=20'
[Discord] [ERROR] err: Couldn't resolve host name

Should the discord_sv file in the addon update to reflect what I changed in the dev console?
timschumi  [developer] Nov 21, 2019 @ 2:42am 
You don't need to change anything in the discord_sv file (or basically any file). Those are just the default values that are used if the variable hasn't been overwritten. You need to keep in mind that reinstalling the addon doesn't clear out the settings you made previously. The variables you changed are probably still stored in "<game folder>/garrysmod/cfg/server.vdf". Clearing them out from there should reset the settings to the default.

In case you are still having issues after that, I published a new version to GitHub, as well as the Workshop. It should now dump the full URL when it encounters an error, so maybe we can see what is causing the issues.
Spudmonkey Nov 21, 2019 @ 6:13am 
It looks like it's working now! I'll have to wait until tomorrow to properly test it, but it binds to my steam ID now. You were right, in the server.vdf file the discord_api was still set as "https://", not sure how that happened... And I used the secret instead of the token before. Thanks for all the help!
Spudmonkey Nov 21, 2019 @ 8:42pm 
Just tested it out with some mates, it binds ID's properly now, but now I get the error "Error while muting: 403/50013 - Missing Permissions". The bot is above everyones roles on discord, and it has Mute Members and Deafen Members permissions.
timschumi  [developer] Nov 21, 2019 @ 11:47pm 
Might be a stupid suggestion, but have you made sure that you saved your changes when modifying the permissions? I forget to do that quite often.

The only reason where that error would occur is when not all the necessary permissions have been applied. My own bot is configured with "Disable Member input and output" (or something similiar), so it should work in theory. Would you be able to give it full Admin permissions to see if that changes anything?
Spudmonkey Nov 22, 2019 @ 1:05am 
If I view the bots permissions in discord Mute and Deafen are still green, so i'm pretty sure it saved. I used the guide from the original ttt discord plugin to make the bot, that should work right? I'll give it admin permissions and see what happens then.
timschumi  [developer] Nov 22, 2019 @ 1:24am 
Ok, so it's not the permissions not being saved. The guide from the original bot will be fine. Keep in mind that the failsafe is now active, you might have to set the `discord_enabled` variable to 1 to make it send requests again.

EDIT: And again, I ♥♥♥♥♥♥ up. Had something messed up with my configuration. Turns out, "Disabling Input/Output of members" (which seems to be "Deafen" in other languages) is totally irrelevant to what the bot does. The important (and the only needed) is actually just the "Mute members" one.
Last edited by timschumi; Nov 22, 2019 @ 1:35am
Spudmonkey Nov 26, 2019 @ 9:03pm 
Sorry for the late reply, only just got some people on to test it again. It works now! Making the bot an admin and putting it at the top of the role list worked, but i'm not sure why just having mute permissions didn't work though. Doesn't really matter I guess.
timschumi  [developer] May 14, 2020 @ 11:51am 
Just set `discord_enabled 1` (which is the "official" way to enable/disable the plugin).
yeet Aug 15, 2020 @ 5:47pm 
Hi, not sure what I'm doing wrong but I have the bot set up and it links to my discord account using the !discord command in game but for some reason the bot will not mute me. I tried giving it admin perms and moving the role to the top of the list but still no luck.
timschumi  [developer] Aug 16, 2020 @ 4:48am 
Ah, I see what the problem is. I'll push out a fix in a few minutes.
timschumi  [developer] Aug 16, 2020 @ 4:52am 
Originally posted by yeet:
Hi, not sure what I'm doing wrong but I have the bot set up and it links to my discord account using the !discord command in game but for some reason the bot will not mute me. I tried giving it admin perms and moving the role to the top of the list but still no luck.

I pushed out an update, please try again. This probably won't fix the issues you originally had, but it will at least display an error message again.
< >
Showing 1-15 of 17 comments
Per page: 1530 50