Skip to content

Commit

Permalink
Resolve minecraft fail to query issue
Browse files Browse the repository at this point in the history
  • Loading branch information
BattlefieldDuck committed Feb 7, 2024
1 parent d90fd51 commit 66dd9d3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions discordgsm/protocols/minecraft.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ async def query(self):

if isinstance(status["description"], str):
name = status["description"]

if "text" in status["description"] and isinstance(
status["description"]["text"], str
):
name = status["description"]["text"]

if "extra" in status["description"] and isinstance(
status["description"]["extra"], list
):
name = "".join(
data.get("text", "") for data in status["description"]["extra"]
)
else:
if "text" in status["description"] and isinstance(
status["description"]["text"], str
):
name = status["description"]["text"]

if "extra" in status["description"] and isinstance(
status["description"]["extra"], list
):
name = "".join(
data.get("text", "") for data in status["description"]["extra"]
)

name = "\n".join(row.strip() for row in name.split("\n"))
players = [
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ backports.zoneinfo==0.2.1;python_version<"3.9"
discord.py==2.3.2
flask[async]==3.0.2
gunicorn==21.2.0
opengsq==3.0.9
opengsq==3.0.10
psycopg2-binary==2.9.9
pymongo==4.6.1
python-dotenv==1.0.1
Expand Down

0 comments on commit 66dd9d3

Please sign in to comment.