AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Source Servers (SRCDS) (https://forums.alliedmods.net/forumdisplay.php?f=130)
-   -   Discord Game Server Monitor - Live server status on Discord v1.7.1 (https://forums.alliedmods.net/showthread.php?t=321899)

Dr.Doctor 03-05-2020 23:38

Discord Game Server Monitor - Live server status on Discord v1.7.1
 
Discord Game Server Monitor

Introduction

Recently, I created a Discord bot that sends out an embed that showing server's details like Status, Current Map and Players, etc. The bot will continue to update the data by editing the message. See:

https://github.com/DiscordGSM/Discor...ges/v1.6.0.png

It supports SourceQuery and UT3Query, most of the game servers using those query methods, including srcds. I had tested the DiscordGSM v1.3.0 on my discord server and my friends' servers too and it is stable, so I am here to introduce this application to you guys. :)

Installation
1. Invite DiscordGSM - https://github.com/DiscordGSM/Discor...ite-DiscordGSM --- Invite the bot now! https://discord.com/oauth2/authorize...4480&scope=bot

2. Deploy to Heroku - https://github.com/DiscordGSM/Discor...ploy-to-Heroku
If you don't want to host on your machine, Heroku is a good choice.

3. Self Hosting - https://github.com/DiscordGSM/Discor...3-Self-Hosting

Source Code

https://github.com/DiscordGSM/DiscordGSM/

Demos

https://doctorserver.tatlead.com/ass...age/dgsm-1.png

https://doctorserver.tatlead.com/ass...age/dgsm-2.png

https://doctorserver.tatlead.com/ass...age/dgsm-3.png

Enjoy :bacon!: :3

Maxximou5 03-06-2020 01:05

Re: Discord Game Server Monitor - Live server status on Discord v1.3.0
 
This is awesome! I especially appreciate the self hosting option you provided. :bacon!:

Sanjay Singh 03-06-2020 02:54

Re: Discord Game Server Monitor - Live server status on Discord v1.3.0
 
https://i.imgur.com/m4SdKkg.png

getting error

Please update doc with easy install from fresh like install required pakages.

Groven 03-06-2020 06:33

Re: Discord Game Server Monitor - Live server status on Discord v1.3.0
 
Thanks!

Dr.Doctor 03-06-2020 14:42

Re: Discord Game Server Monitor - Live server status on Discord v1.3.0
 
Quote:

Originally Posted by Sanjay Singh (Post 2685942)
https://i.imgur.com/m4SdKkg.png

getting error

Please update doc with easy install from fresh like install required pakages.

Also, you can do
Code:

pip install -r requirements.txt
to install the required packages.

Sanjay Singh 03-06-2020 20:44

Re: Discord Game Server Monitor - Live server status on Discord v1.3.0
 
Actually I am getting error with command pip.
I will try again

DARG367 03-06-2020 23:28

Re: Discord Game Server Monitor - Live server status on Discord v1.3.0
 
This might be a dumb question. But you create your own Discord bot right? Because I didn't see anywhere the ID of DiscordGSM. So I created my own Discord bot and input it's ID into the link to invite it to my server and it does not appear to be online.

I used the Deploy to Heroku on the wiki from the GitHub.

When I also run python3 getbotinvitelink.py

I get this
PHP Code:

Traceback (most recent call last):
  
File "getbotinvitelink.py"line 7in <module>
    
TOKEN os.environ["TOKEN"]
  
File "/app/.heroku/python/lib/python3.6/os.py"line 669in __getitem__
    raise KeyError
(keyfrom None
KeyError
'TOKEN' 

Any ideas? Is there anything else I can provide you to help?

MAMAC 03-07-2020 09:42

Re: Discord Game Server Monitor - Live server status on Discord v1.3.0
 
Quote:

Originally Posted by DARG367 (Post 2686051)
This might be a dumb question. But you create your own Discord bot right? Because I didn't see anywhere the ID of DiscordGSM. So I created my own Discord bot and input it's ID into the link to invite it to my server and it does not appear to be online.

I used the Deploy to Heroku on the wiki from the GitHub.

When I also run python3 getbotinvitelink.py

I get this
PHP Code:

Traceback (most recent call last):
  
File "getbotinvitelink.py"line 7in <module>
    
TOKEN os.environ["TOKEN"]
  
File "/app/.heroku/python/lib/python3.6/os.py"line 669in __getitem__
    raise KeyError
(keyfrom None
KeyError
'TOKEN' 

Any ideas? Is there anything else I can provide you to help?

Yes i have the same problem on heroku https://i.imgur.com/TGtAPU7.png

Dr.Doctor 03-07-2020 09:47

Re: Discord Game Server Monitor - Live server status on Discord v1.3.0
 
Quote:

Originally Posted by DARG367 (Post 2686051)
This might be a dumb question. But you create your own Discord bot right? Because I didn't see anywhere the ID of DiscordGSM. So I created my own Discord bot and input it's ID into the link to invite it to my server and it does not appear to be online.

I used the Deploy to Heroku on the wiki from the GitHub.

When I also run python3 getbotinvitelink.py

I get this
PHP Code:

Traceback (most recent call last):
  
File "getbotinvitelink.py"line 7in <module>
    
TOKEN os.environ["TOKEN"]
  
File "/app/.heroku/python/lib/python3.6/os.py"line 669in __getitem__
    raise KeyError
(keyfrom None
KeyError
'TOKEN' 

Any ideas? Is there anything else I can provide you to help?

You are right, you need to create your own discord bot on https://discordapp.com/developers/applications/ and create a bot token by yourself.

For the getbotinvitelink.py issue, I confirm that is a bug and I just fixed it sorry for that.
Alternatively, you can invite the bot directly by https://discordapp.com/api/oauth2/authorize?client_id=<bot-id>&permissions=268954704&scope=bot

For the bot online issue, you need to enable the worker on. See: https://github.com/DiscordGSM/Discor...ploy-to-Heroku - Step 3
If the bot is still not online, maybe you had entered the bot id instead of bot token.

Dr.Doctor 03-07-2020 09:56

Re: Discord Game Server Monitor - Live server status on Discord v1.3.0
 
Quote:

Originally Posted by MAMAC (Post 2686097)
Yes i have the same problem on heroku https://i.imgur.com/TGtAPU7.png

@DARG367 and @MAMAC, please redeploy here thanks: https://heroku.com/deploy?template=h...SM/DiscordGSM/

MAMAC 03-07-2020 12:03

Re: Discord Game Server Monitor - Live server status on Discord v1.3.0
 
Solved and running.... tnx

https://i.imgur.com/PIoaXr5.png

DARG367 03-07-2020 16:56

Re: Discord Game Server Monitor - Live server status on Discord v1.3.0
 
Quote:

Originally Posted by Dr.Doctor (Post 2686098)
You are right, you need to create your own discord bot on https://discordapp.com/developers/applications/ and create a bot token by yourself.

For the getbotinvitelink.py issue, I confirm that is a bug and I just fixed it sorry for that.
Alternatively, you can invite the bot directly by https://discordapp.com/api/oauth2/authorize?client_id=<bot-id>&permissions=268954704&scope=bot

For the bot online issue, you need to enable the worker on. See: https://github.com/DiscordGSM/Discor...ploy-to-Heroku - Step 3
If the bot is still not online, maybe you had entered the bot id instead of bot token.

As for the bot token, I'm grabbing it from the actual bot tab in the application as shown in the picture.
https://imgur.com/a/VRx7Kn5

And the dyno worker is on as I went to go configure it turned it on and saved changes. Shown below.
https://imgur.com/a/QKrs4dA

I also uploaded the servers.json file to the channel I want the bot to display the servers which is a test channel which the bot has access to. I also copied the link not the ID of the post. The .json file because it has nothing not already public I will show below. https://cdn.discordapp.com/attachmen...1/servers.json
PHP Code:

[
    {
        
"type""SourceQuery",
        
"game""Left 4 Dead 2",
        
"addr""160.202.167.15",
        
"port"27015,
        
"channel"686050566815612998,
        
"image_url""https://cdn.discordapp.com/attachments/656928917453668352/687400651084660751/BITFOR.jpg"
    
},
    {
        
"type""SourceQuery",
        
"game""Left 4 Dead 2",
        
"addr""189.1.173.122",
        
"port"27035,
        
"channel"686050566815612998,
        
"image_url""https://cdn.discordapp.com/attachments/656928917453668352/686111709483892752/MICURA.jpg"
    
},
    {
        
"type""SourceQuery",
        
"game""Left 4 Dead 2",
        
"addr""177.54.157.71",
        
"port"27045,
        
"channel"686050566815612998,
        
"image_url""https://cdn.discordapp.com/attachments/656928917453668352/686111709483892752/MICURA.jpg"
    
},
    {
        
"type""SourceQuery",
        
"game""Left 4 Dead 2",
        
"addr""103.195.102.218",
        
"port"27035,
        
"channel"686050566815612998,
        
"image_url""https://cdn.discordapp.com/attachments/656928917453668352/686111709483892752/MICURA.jpg"
    
}


Still, the bot is offline. Even after restarting all dynos. I'm pretty sure I am following everything correctly. Although I can't seem to find the "SETTINGS_JSON_URL" config if there even is one?

Dr.Doctor 03-07-2020 21:42

Re: Discord Game Server Monitor - Live server status on Discord v1.3.0
 
Quote:

Originally Posted by DARG367 (Post 2686145)
As for the bot token, I'm grabbing it from the actual bot tab in the application as shown in the picture.
https://imgur.com/a/VRx7Kn5

And the dyno worker is on as I went to go configure it turned it on and saved changes. Shown below.
https://imgur.com/a/QKrs4dA

I also uploaded the servers.json file to the channel I want the bot to display the servers which is a test channel which the bot has access to. I also copied the link not the ID of the post. The .json file because it has nothing not already public I will show below. https://cdn.discordapp.com/attachmen...1/servers.json
PHP Code:

[
    {
        
"type""SourceQuery",
        
"game""Left 4 Dead 2",
        
"addr""160.202.167.15",
        
"port"27015,
        
"channel"656928917453668352,
        
"image_url""https://github.com/DiscordGSM/DiscordGSM/blob/master/images/discordgsm.png?raw=true"
    
},
    {
        
"type""SourceQuery",
        
"game""Left 4 Dead 2",
        
"addr""189.1.173.122",
        
"port"27035,
        
"channel"656928917453668352
    
},
    {
        
"type""SourceQuery",
        
"game""Left 4 Dead 2",
        
"addr""177.54.157.71",
        
"port"27045,
        
"channel"656928917453668352
    
},
    {
        
"type""SourceQuery",
        
"game""Left 4 Dead 2",
        
"addr""103.195.102.218",
        
"port"27035,
        
"channel"656928917453668352
    
}


Still, the bot is offline. Even after restarting all dynos. I'm pretty sure I am following everything correctly. Although I can't seem to find the "SETTINGS_JSON_URL" config if there even is one?

Thanks for the report details. I recently figured out when the env `SETTINGS_JSON_URL`is blank will cause the error on bot startup.

Please remove `SETTINGS_JSON_URL` to fix the issue.

It is under Settings -> Config Vars => Reveal Config Vars and remove it thanks.

DARG367 03-07-2020 22:17

Re: Discord Game Server Monitor - Live server status on Discord v1.3.0
 
Quote:

Originally Posted by Dr.Doctor (Post 2686183)
Thanks for the report details. I recently figured out when the env `SETTINGS_JSON_URL`is blank will cause the error on bot startup.

Please remove `SETTINGS_JSON_URL` to fix the issue.

It is under Settings -> Config Vars => Reveal Config Vars and remove it thanks.

Removed `SETTINGS_JSON_URL` from Config Vars then `Restart All Dynos` and it worked perfectly!

Thanks for the support and the amazing work!

https://imgur.com/a/Ud9CIuB

ONIONZZZ 03-08-2020 00:38

Re: Discord Game Server Monitor - Live server status on Discord v1.3.0
 
https://i.imgur.com/1YiZJco.png

https://i.imgur.com/eGMJn5J.png

Wow almost looks like something I made years ago which has since been copied by about 50 communities

Sanjay Singh 03-08-2020 05:10

Re: Discord Game Server Monitor - Live server status on Discord v1.3.0
 
I have tested this bot with self-hosting & its working smoothly waiting for you to add more features to it in next version.

Dr.Doctor 03-08-2020 20:59

Re: Discord Game Server Monitor - Live server status on Discord v1.3.0
 
Quote:

Originally Posted by ONIONZZZ (Post 2686198)
https://i.imgur.com/1YiZJco.png

https://i.imgur.com/eGMJn5J.png

Wow almost looks like something I made years ago which has since been copied by about 50 communities

nice.

Quote:

Originally Posted by Sanjay Singh (Post 2686210)
I have tested this bot with self-hosting & its working smoothly waiting for you to add more features to it in next version.

Thanks for using DiscordGSM! :) In the future, more variety of game servers will be supported, and more features for sure.

DruGzOG 03-09-2020 16:21

Re: Discord Game Server Monitor - Live server status on Discord v1.3.0
 
1 Attachment(s)
Instead of map thumbnails, why not their respective game? I attached an example of one we run our discord using js

Dr.Doctor 03-11-2020 09:51

Re: Discord Game Server Monitor - Live server status on Discord v1.3.0
 
Quote:

Originally Posted by DruGzOG (Post 2686412)
Instead of map thumbnails, why not their respective game? I attached an example of one we run our discord using js

DiscordGSM support custom thumbnail :)

Code:

{
    "type": "SourceQuery",
    "game": "Team Fortress 2",
    "addr": "122.128.109.245",
    "port": 27030,
    "channel": 686352354110472203,
    "image_url": "https://pbs.twimg.com/profile_images/1107047014628364288/g2DYsm_7_400x400.jpg"
},

If you want to see more example, you can join our discord server https://discord.gg/Cg4Au9T

hckr 04-19-2020 16:38

Re: Discord Game Server Monitor - Live server status on Discord v1.4.0
 
Heya! you can also add GoldSRC?

DruGzOG 04-19-2020 18:47

Re: Discord Game Server Monitor - Live server status on Discord v1.4.0
 
Quote:

Originally Posted by hckr (Post 2694658)
Heya! you can also add GoldSRC?

Supports source query, so Goldsrc is supported. https://github.com/xPaw/PHP-Source-Query

Dr.Doctor 04-20-2020 05:53

Re: Discord Game Server Monitor - Live server status on Discord v1.4.0
 
Quote:

Originally Posted by hckr (Post 2694658)
Heya! you can also add GoldSRC?

GoldSource already supported.

Spoiper 04-25-2020 10:57

Re: Discord Game Server Monitor - Live server status on Discord v1.4.0
 
Heya, i have no idea how python works since i've never used it besides generating a tf2idb file.
How do in install the dependencies? what prompt do i open?

hckr 04-26-2020 23:24

Re: Discord Game Server Monitor - Live server status on Discord v1.4.0
 
Thanks DruGzOG and Dr.Doctor

It would be good to add a tag for each server that is added, so the user can see the server that interests him and also the nicks that are on the server, I hope it can be implemented.

Dr.Doctor 05-06-2020 05:12

Re: Discord Game Server Monitor - Live server status on Discord v1.6.0
 
v1.6.0 released, support GamedigQuery, which means it allows query more game servers!

https://github.com/DiscordGSM/DiscordGSM

Deploy to Heroku: https://github.com/DiscordGSM/Discor...ploy-to-Heroku

Self Hosting: https://github.com/DiscordGSM/Discor...3-Self-Hosting

Bons4i 05-11-2020 05:34

Re: Discord Game Server Monitor - Live server status on Discord v1.6.0
 
Hey I have a problem.
I followed the install instructions but it doesn't work.
when I run ./bot.sh it always comes:https://prnt.sc/seoxyz

Please help me

Bons4i

Dr.Doctor 05-11-2020 14:18

Re: Discord Game Server Monitor - Live server status on Discord v1.6.0
 
Quote:

Originally Posted by Bons4i (Post 2699430)
Hey I have a problem.
I followed the install instructions but it doesn't work.
when I run ./bot.sh it always comes:https://prnt.sc/seoxyz

Please help me

Bons4i

DiscordGSM requires Python >=3.6, please install python3 and try to start the bot again thanks.

Dr.Doctor 05-25-2020 18:19

Re: Discord Game Server Monitor - Live server status on Discord v1.7.1
 
Instead of Deploy to Heroku and self-hosting, DiscordGSM provides a public bot service so you just need to invite the bot to your discord server without much setup and configuration and add game servers by commands easily. :bee:

Invite DiscordGSM: https://discord.com/oauth2/authorize...4480&scope=bot

How to add server guide: https://github.com/DiscordGSM/Discor...ite-DiscordGSM

https://tatlead.com/static/DiscordGSM-Public.png

BiohazardLucifer 06-08-2021 20:45

Re: Discord Game Server Monitor - Live server status on Discord v1.7.1
 
DiscordGSM
BOT
— Today at 1:45 AM
:warning: Fail to add the server. Reason: Fail to query the game server

why ?

Nightmare Pyro 07-08-2021 12:54

Re: Discord Game Server Monitor - Live server status on Discord v1.7.1
 
^^^^^^^^^^^
I got that same error today on heroku...

EDITED - My bot has fixed within 1.8.3v Heroku!

XpycT_ 03-16-2022 00:25

Re: Discord Game Server Monitor - Live server status on Discord v1.7.1
 
Hello,

I have problem...

File "/home/container/bot.py", line 26, in <module>
segs = os.getenv("DGSM_TOKEN").split(".")
AttributeError: 'NoneType' object has no attribute 'split'


All times are GMT -4. The time now is 12:54.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.