1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-27 13:34:28 +00:00

Weird discordpy behaviour

This commit is contained in:
Steffo 2018-09-19 18:20:56 +02:00
parent 3fadd2cefa
commit 1e1f111438
2 changed files with 6 additions and 4 deletions

View file

@ -8,7 +8,6 @@ import logging
import coloredlogs
import os
logging.getLogger().disabled = True
logger = logging.getLogger(__name__)
os.environ["COLOREDLOGS_LOG_FORMAT"] = "%(asctime)s %(levelname)s %(name)s %(message)s"

View file

@ -414,10 +414,13 @@ class RoyalDiscordBot(discord.Client):
if member.activity.type == discord.ActivityType.playing:
message += f" | 🎮 {member.activity.name}"
# Rich presence
if member.activity.state:
try:
message += f" ({member.activity.state})"
elif member.activity.details:
except AttributeError:
try:
message += f" ({member.activity.details})"
except AttributeError:
pass
elif member.activity.type == discord.ActivityType.streaming:
message += f" | 📡 [{member.activity.name}]({member.activity.url})"
elif member.activity.type == discord.ActivityType.listening: