mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
Weird discordpy behaviour
This commit is contained in:
parent
3fadd2cefa
commit
1e1f111438
2 changed files with 6 additions and 4 deletions
1
bots.py
1
bots.py
|
@ -8,7 +8,6 @@ import logging
|
||||||
import coloredlogs
|
import coloredlogs
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
logging.getLogger().disabled = True
|
logging.getLogger().disabled = True
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
os.environ["COLOREDLOGS_LOG_FORMAT"] = "%(asctime)s %(levelname)s %(name)s %(message)s"
|
os.environ["COLOREDLOGS_LOG_FORMAT"] = "%(asctime)s %(levelname)s %(name)s %(message)s"
|
||||||
|
|
|
@ -414,10 +414,13 @@ class RoyalDiscordBot(discord.Client):
|
||||||
if member.activity.type == discord.ActivityType.playing:
|
if member.activity.type == discord.ActivityType.playing:
|
||||||
message += f" | 🎮 {member.activity.name}"
|
message += f" | 🎮 {member.activity.name}"
|
||||||
# Rich presence
|
# Rich presence
|
||||||
if member.activity.state:
|
try:
|
||||||
message += f" ({member.activity.state})"
|
message += f" ({member.activity.state})"
|
||||||
elif member.activity.details:
|
except AttributeError:
|
||||||
message += f" ({member.activity.details})"
|
try:
|
||||||
|
message += f" ({member.activity.details})"
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
elif member.activity.type == discord.ActivityType.streaming:
|
elif member.activity.type == discord.ActivityType.streaming:
|
||||||
message += f" | 📡 [{member.activity.name}]({member.activity.url})"
|
message += f" | 📡 [{member.activity.name}]({member.activity.url})"
|
||||||
elif member.activity.type == discord.ActivityType.listening:
|
elif member.activity.type == discord.ActivityType.listening:
|
||||||
|
|
Loading…
Reference in a new issue