Update server_commands.py

This commit is contained in:
Elmon11 2020-12-02 22:41:20 +01:00 committed by GitHub
parent 660c074450
commit 3227452dec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,12 +1,11 @@
import discord import discord
import requests import requests
import re
from checks import * from checks import *
from discord.ext import commands from discord.ext import commands
from datetime import datetime from datetime import datetime
from functions import * from functions import *
from unicode import * from unicode import *
from telnetlib import Telnet
class ServerCommands(commands.Cog): class ServerCommands(commands.Cog):
def __init__(self, bot): def __init__(self, bot):
@ -205,7 +204,7 @@ class ServerCommands(commands.Cog):
'Gets the current status of the Server' 'Gets the current status of the Server'
em = discord.Embed() em = discord.Embed()
try: try:
json = requests.get("http://play.totalfreedom.me:28966/list?json=true", timeout=5).json() requests.get("http://play.totalfreedom.me:28966/list?json=true", timeout=5).json()
except: except:
em.description = 'Server is offline' em.description = 'Server is offline'
em.colour = 0xFF0000 em.colour = 0xFF0000