Garry's Mod

Garry's Mod

Garry's Mod Discord Bot
 此主题已被置顶,因此可能具有重要性
timschumi  [开发者] 2019 年 11 月 20 日 上午 11:15
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)
最后由 timschumi 编辑于; 2020 年 1 月 14 日 上午 5:04
< >
正在显示第 1 - 15 条,共 17 条留言
Spudmonkey 2019 年 11 月 20 日 下午 3:38 
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 2019 年 11 月 20 日 下午 3:39 
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  [开发者] 2019 年 11 月 20 日 下午 3:58 
The Token is the "Bot Token" (found in the Bot tab), not the "Client Secret".
最后由 timschumi 编辑于; 2019 年 11 月 20 日 下午 4:00
Spudmonkey 2019 年 11 月 20 日 下午 4:50 
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  [开发者] 2019 年 11 月 21 日 上午 2:42 
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 2019 年 11 月 21 日 上午 6:13 
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 2019 年 11 月 21 日 下午 8:42 
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  [开发者] 2019 年 11 月 21 日 下午 11:47 
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 2019 年 11 月 22 日 上午 1:05 
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  [开发者] 2019 年 11 月 22 日 上午 1:24 
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.
最后由 timschumi 编辑于; 2019 年 11 月 22 日 上午 1:35
Spudmonkey 2019 年 11 月 26 日 下午 9:03 
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  [开发者] 2020 年 5 月 14 日 上午 11:51 
Just set `discord_enabled 1` (which is the "official" way to enable/disable the plugin).
yeet 2020 年 8 月 15 日 下午 5:47 
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  [开发者] 2020 年 8 月 16 日 上午 4:48 
Ah, I see what the problem is. I'll push out a fix in a few minutes.
timschumi  [开发者] 2020 年 8 月 16 日 上午 4:52 
引用自 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.
< >
正在显示第 1 - 15 条,共 17 条留言
每页显示数: 1530 50