Cornflake Posted August 20, 2021 Share Posted August 20, 2021 (edited) Monitor your game servers on Discord and tracks the live data of your game servers. You need an API Key for your settings.json Config. Spoiler Obtaining an API Key: Visit the official Discord Developers page here: https://discord.com/developers/applications/ -Click "New App". -Name your app and click create! Note: A description isn't required. -You will now be redirected to your created app, at the point you will need to click "Create a Bot User". -Under the newly created bot section, under "Username" you will see "Token". Reveal the token and copy it into your servers config. -Now it's time to add your new bot to your guild! To add your bot to your guild you must visit the following link, and replace "botUserID" with the client ID found at the top of your Discord app settings page:https://discordapp.com/oauth2/authorize?client_id=botUserID&scope=bot&permissions=8 Note: "permissions=8" in the link will provide the bot with administrative permissions so you won't have to give it some. Note: DO NOT SHARE YOUR API KEY! Sharing your key may result in punishments from Discord (including a platform-wide ban) if the token is used to abuse the API. For commands and How-To's just look at the Guides on the official Page https://discordgsm.com/guide This is in case you still want to use DiscordGSM v.1.9.3. Now named "Discord-GameServerMonitor-Classic" This does not apply for the newest version of DGSM Quote Configure your Monitored Servers in the servers.json: https://github.com/DiscordGSM/DiscordGSM/wiki/servers.json Example Servers.json [ { "comment": "7 Days to Die | In the Server channel", "type": "GamedigQuery", "game": "7d2d", "address": "7d2d.domain.ca", "port": 25000, "channel": 745044509741321321, "image_url": "https://github.com/patrix87/DiscordLogGSM/blob/master/images/7dtd.png?raw=true", "custom": "Visit <#875131864359321321> via <#46560149126321321>.", "steam_id": 251570, "direct_join": true, "country": "CA", "color": "#bf0b01", "title": "7 Days to Die", "public_address": "7d2d.domain.ca:25000", "locked": true, "maxplayers": 32, "hostname": "My 7 Days To Die Server" }, { "comment": "7 Days to Die | In the 7 Days to die channel", "type": "GamedigQuery", "game": "7d2d", "address": "7d2d.domain.ca", "port": 25000, "channel": 745044509951123123, "image_url": "https://github.com/patrix87/DiscordLogGSM/blob/master/images/7dtd.png?raw=true", "custom": "**PVE SERVER** Join vocal when playing", "steam_id": 251570, "direct_join": true, "country": "CA", "color": "#bf0b01", "title": "7 Days to Die", "public_address": "7d2d.domain.ca:25000", "locked": true, "password": "serverpassword", "maxplayers": 32, "hostname": "My 7 Days To Die Server" }, { "comment": "ARK | Ark Channel", "type": "GamedigQuery", "game": "arkse", "address": "ark.domain.ca", "port": 27016, "channel": 745044509741547522, "image_url": "https://github.com/patrix87/DiscordLogGSM/blob/master/images/ark.png?raw=true", "custom": "Visit <#343135886478123123> via <#465601491261654654>.", "steam_id": 346110, "direct_join": false, "country": false, "color": "#b6ccda", "title": "ARK : Survival Evolved", "public_address": "ark.domain.ca", "locked": false, "map": false, "hostname": "My ARK Server" } ] Update 1.9.2 You have to Manually reconfigure your Servers.json and Settings.json (Renamed to ".env" it’s a hidden file. Make sure u display hidden files.) just rename your current config files and start the container so it generates new configs Edited November 6, 2022 by Cornflake Quote Link to comment
Mr_Jay84 Posted September 3, 2021 Share Posted September 3, 2021 I'm a bit lost here mate as the "Username" and "Token" isn't there. Do these translate to "Client ID" and "Client Secret" under the OAuth2 page? Quote Link to comment
Cornflake Posted September 6, 2021 Author Share Posted September 6, 2021 (edited) On 9/3/2021 at 6:37 PM, Mr_Jay84 said: I'm a bit lost here mate as the "Username" and "Token" isn't there. Do these translate to "Client ID" and "Client Secret" under the OAuth2 page? Hey, No its Under "bot" You Create the "app" like you did, and then under "bot" -> "Add Bot" to create the actual Bot. And there you will find the Token Edited September 6, 2021 by Cornflake 1 Quote Link to comment
Mr_Jay84 Posted September 7, 2021 Share Posted September 7, 2021 Of course! Thanks mate! Quote Link to comment
mattj Posted January 19, 2022 Share Posted January 19, 2022 Hey, gettin this error can you help? Quote usermod: no changes usermod: no changes Server Config found! Settings Config found! Traceback (most recent call last): File "/dgsm-docker/bot.py", line 442, in <module> discordgsm = DiscordGSM(client) File "/dgsm-docker/bot.py", line 64, in __init__ self.servers = Servers() File "/dgsm-docker/servers.py", line 14, in __init__ self.refresh() File "/dgsm-docker/servers.py", line 18, in refresh servers = self.get() File "/dgsm-docker/servers.py", line 49, in get return json.loads(data) File "/usr/local/lib/python3.10/json/__init__.py", line 346, in loads return _default_decoder.decode(s) File "/usr/local/lib/python3.10/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/lib/python3.10/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 8 column 20 (char 192) Thanks Quote Link to comment
Cornflake Posted January 19, 2022 Author Share Posted January 19, 2022 looks like theres an issue with your config, can you send me your config so i can take a look at it greets Quote Link to comment
Cornflake Posted February 13, 2022 Author Share Posted February 13, 2022 (edited) 8 minutes ago, Natcoso9955 said: Hi, im having an issue with this retrieving my project zomboid server, i believe its due to the game running on a udp port not a tcp port. This is the only thing i can think would be the cause. Are you able to advise how i set the server config to connect via udp not tcp. Thanks. hey, you could try this, it should work: { "comment": "project zomboid", "type": "gamedigquery", "game": "przomboid", "address": "YOUR GAME SERVER IP HERE", "port": YOUR PORT HERE, (should be 16261 if i am not wrong) "channel": YOUR CHANNEL ID HERE, "locked": false } query info's are always using udp for what i am knowing. you need to make sure youre port is forwarded if you hosting it locally Edited February 13, 2022 by Cornflake Quote Link to comment
Natcoso9955 Posted March 2, 2022 Share Posted March 2, 2022 On 2/13/2022 at 12:56 PM, Cornflake said: hey, you could try this, it should work: { "comment": "project zomboid", "type": "gamedigquery", "game": "przomboid", "address": "YOUR GAME SERVER IP HERE", "port": YOUR PORT HERE, (should be 16261 if i am not wrong) "channel": YOUR CHANNEL ID HERE, "locked": false } query info's are always using udp for what i am knowing. you need to make sure youre port is forwarded if you hosting it locally So it turns out my issues was i had looked at this before it was on community apps, I had my old config file still there and didnt realise some stuff had changed. 1 Quote Link to comment
workermaster Posted March 10, 2022 Share Posted March 10, 2022 Hi, I am trying to install this but am having some issues getting it to work. I have never added a bot before so this could just be me not knowing how this all works. I have tried following these steps at the top of this page: On 8/20/2021 at 4:06 PM, Cornflake said: Obtaining an API Key: Visit the official Discord Developers page here: https://discord.com/developers/applications/ -Click "New App". -Name your app and click create! Note: A description isn't required. -You will now be redirected to your created app, at the point you will need to click "Create a Bot User". -Under the newly created bot section, under "Username" you will see "Token". Reveal the token and copy it into your servers config. -Now it's time to add your new bot to your guild! To add your bot to your guild you must visit the following link, and replace "botUserID" with the client ID found at the top of your Discord app settings page:https://discordapp.com/oauth2/authorize?client_id=botUserID&scope=bot&permissions=8 Note: "permissions=8" in the link will provide the bot with administrative permissions so you won't have to give it some. I have created a new app and bot. The bot ID is copied in the env file on line 1: I then went to this link https://discordapp.com/oauth2/authorize?client_id=botUserID&scope=bot&permissions=8 and replaced the botID but got this error message: I also don't understand what I need to fill in at line 3 called "DGSM_ROLEID=123". Quote Link to comment
Cornflake Posted March 10, 2022 Author Share Posted March 10, 2022 (edited) 13 minutes ago, workermaster said: Hi, I am trying to install this but am having some issues getting it to work. I have never added a bot before so this could just be me not knowing how this all works. I have tried following these steps at the top of this page: I have created a new app and bot. The bot ID is copied in the env file on line 1: I then went to this link https://discordapp.com/oauth2/authorize?client_id=botUserID&scope=bot&permissions=8 and replaced the botID but got this error message: I also don't understand what I need to fill in at line 3 called "DGSM_ROLEID=123". Looks good for me. you can leave the role id as it is, i think you missed the part where it says: "Now it's time to add your new bot to your guild! To add your bot to your guild you must visit the following link, and replace "botUserID" with the client ID found at the top of your Discord app settings page:https://discordapp.com/oauth2/authorize?client_id=botUserID&scope=bot&permissions=8" it looks like you just went to the link as it shows. but you need to replace "botUserID" to your actual Bot ID shown on the discord website. https://discordapp.com/oauth2/authorize?client_id= "botUserID" &scope=bot&permissions=8" Try this and let me know edit: The BotId is called Application ID now i think. Edited March 10, 2022 by Cornflake Quote Link to comment
workermaster Posted March 10, 2022 Share Posted March 10, 2022 5 minutes ago, Cornflake said: Looks good for me you can leave the role id as it is, i think you missed the part where it says: "Now it's time to add your new bot to your guild! To add your bot to your guild you must visit the following link, and replace "botUserID" with the client ID found at the top of your Discord app settings page:https://discordapp.com/oauth2/authorize?client_id=botUserID&scope=bot&permissions=8" it looks like you just went to the link as it shows. but you need to replace "botUserID" to your actual Bot ID shown on the discord website. https://discordapp.com/oauth2/authorize?client_id= "botUserID" &scope=bot&permissions=8" Try this and let me know Thanks for the quick reply. Unfortunately, I still manage to mess it up (I got a talent for that) At first I thought that it needed the Bot number (7190) shown here: I then tried the top of the settings page you mentioned. I think that you mean this page: I entered my own 4 digit ID number but that resulted in the same "Unknown application error" Could it be that I just have the wrong number and am looking at the wrong place? Quote Link to comment
Cornflake Posted March 10, 2022 Author Share Posted March 10, 2022 Unfortunately, you were looking at the wrong place. you will find the application id of your bot at https://discord.com/developers/applications/ Quote Link to comment
workermaster Posted March 11, 2022 Share Posted March 11, 2022 21 hours ago, Cornflake said: Unfortunately, you were looking at the wrong place. you will find the application id of your bot at https://discord.com/developers/applications/ Thanks! That got it working a bit better now. I have manged to add the bot to Discord but get an error in the container console and do not know how to use the bot in Discord. For now I have only filled out the mandatory fields in the servers.json: Quote Link to comment
Cornflake Posted March 11, 2022 Author Share Posted March 11, 2022 4 hours ago, workermaster said: Thanks! That got it working a bit better now. I have manged to add the bot to Discord but get an error in the container console and do not know how to use the bot in Discord. For now I have only filled out the mandatory fields in the servers.json: could you please paste your servers.json here? you can blank the channel and adress. but its quite easy to get a json format error if theres a Space or comma missing Quote Link to comment
workermaster Posted March 12, 2022 Share Posted March 12, 2022 18 hours ago, Cornflake said: could you please paste your servers.json here? you can blank the channel and adress. but its quite easy to get a json format error if theres a Space or comma missing Here are the files. I have removed the middle part of the sensitive data. servers.json.env We managed to figure out how to access the bot. Turned out we needed to say "!servers". The problem with that is that only I can get the bot to give us an aswer and others keep getting the message that they do not have permission to do that. Quote Link to comment
Cornflake Posted March 12, 2022 Author Share Posted March 12, 2022 31 minutes ago, workermaster said: Here are the files. I have removed the middle part of the sensitive data. servers.json 1.51 kB · 1 download .env 651 B · 1 download We managed to figure out how to access the bot. Turned out we needed to say "!servers". The problem with that is that only I can get the bot to give us an aswer and others keep getting the message that they do not have permission to do that. Could you please try this Json? dont forget to re-add your IP and channel ID servers.json Quote Link to comment
workermaster Posted March 12, 2022 Share Posted March 12, 2022 1 hour ago, Cornflake said: Could you please try this Json? dont forget to re-add your IP and channel ID servers.json 191 B · 0 downloads I tried your file but still get an error I can ask the bot to show me the servers but it doesn't look like the image shown in the community applications downlaod page; Quote Link to comment
Cornflake Posted March 12, 2022 Author Share Posted March 12, 2022 (edited) sorry my bad, the Port and channel should not be in quotes. please try this again you dont have to write anything to the bot, he will post the message (in the channel you setup) on startup and he will update it every minute (you can change how often) servers.json Edited March 12, 2022 by Cornflake Quote Link to comment
Nubby Posted March 12, 2022 Share Posted March 12, 2022 22 minutes ago, Cornflake said: sorry my bad, the Port and channel should not be in quotes. please try this again you dont have to write anything to the bot, he will post the message (in the channel you setup) on startup and he will update it every minute (you can change how often) servers.json 189 B · 1 download Hi there. I have been following along with all the updated json configs as im having all the same issues. So far this is all im able to get: With the log looking similar to others This is using your most recently posted json config. Any chance you have a discord we could hop into? Quote Link to comment
workermaster Posted March 12, 2022 Share Posted March 12, 2022 (edited) 1 hour ago, Cornflake said: sorry my bad, the Port and channel should not be in quotes. please try this again you dont have to write anything to the bot, he will post the message (in the channel you setup) on startup and he will update it every minute (you can change how often) servers.json 189 B · 1 download I have changed the servers.json but still get the error; This is how the servers.json looks now; EDIT: After changing the quotes, I now got the first message from the bot in the channel. How do I add more servers? Just add them to the servers.json file or do I need to add more servers.json files? Edited March 12, 2022 by workermaster Quote Link to comment
workermaster Posted March 12, 2022 Share Posted March 12, 2022 48 minutes ago, Nubby said: Hi there. I have been following along with all the updated json configs as im having all the same issues. So far this is all im able to get: With the log looking similar to others This is using your most recently posted json config. Any chance you have a discord we could hop into? I managed to get a little bit more information (name and IP) but the bot only posts one status update. It does not send a new one. Did you get that to work? Quote Link to comment
Nubby Posted March 12, 2022 Share Posted March 12, 2022 35 minutes ago, workermaster said: I managed to get a little bit more information (name and IP) but the bot only posts one status update. It does not send a new one. Did you get that to work? Yea. I was able to get more output with other json configs. I was never able to get a server online status or player count. Im not sure if i misunderstand your first part but the bot posts the initial message then updates it as it polls for new informaiton. Quote Link to comment
Cornflake Posted March 13, 2022 Author Share Posted March 13, 2022 9 hours ago, Nubby said: Hi there. I have been following along with all the updated json configs as im having all the same issues. So far this is all im able to get: With the log looking similar to others This is using your most recently posted json config. Any chance you have a discord we could hop into? looks fine for me, your bot is working. but looks like it cannot reach your server. do you host locally? did you forward the port?. i did see that valheim uses port 2457 for query requests. so this port must be forwarded too. and you have to put this port into your servers.json and based on the documentation on gamediqquery your valheim server must be in Public mode Quote Valheim Valheim servers will only respond to queries if they are started in public mode (-public 1). Quote Link to comment
workermaster Posted March 17, 2022 Share Posted March 17, 2022 On 3/13/2022 at 5:53 AM, Cornflake said: looks fine for me, your bot is working. but looks like it cannot reach your server. do you host locally? did you forward the port?. i did see that valheim uses port 2457 for query requests. so this port must be forwarded too. and you have to put this port into your servers.json and based on the documentation on gamediqquery your valheim server must be in Public mode I have taken a short break from finishing the bot but am back now. I get the same problem as @Nubby Friends are able to reach the Terraria server and can game on it. The port is forwarded so it should be reachable. Here is the servers.json; I have no idea why it doesn't work. I also wonder how I would add a gameserver to this file that is not on gamediqquery? I have multiple Wreckfest servers but Wreckfest (and Satisfactory and Open RCT2) are not on Gamediqquery. Quote Link to comment
Cornflake Posted March 17, 2022 Author Share Posted March 17, 2022 (edited) 28 minutes ago, workermaster said: I have taken a short break from finishing the bot but am back now. I get the same problem as @Nubby Friends are able to reach the Terraria server and can game on it. The port is forwarded so it should be reachable. Here is the servers.json; I have no idea why it doesn't work. I also wonder how I would add a gameserver to this file that is not on gamediqquery? I have multiple Wreckfest servers but Wreckfest (and Satisfactory and Open RCT2) are not on Gamediqquery. Hey, So your valheim server seems to works now. That’s good to know, what was your issue now? If gamedigquery doesn’t list your game it will basically not work you have to use one of the other Query types: sourcequery , ut3query or fake https://github.com/DiscordGSM/DiscordGSM/wiki/SourceQuery https://github.com/DiscordGSM/DiscordGSM/wiki/UT3Query i don’t know what query type Terria is using, but you could try if one of it works basically you don’t need gamedigquery at all, as an example I used sourcequery for all my GameServers a while ago and it worked the same. you just need to look what query port you game uses and what Protocol. And don’t forget to forward the UDP port. Edited March 17, 2022 by Cornflake Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.