mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-24 03:54:20 +00:00
Improve /cv with the streaming status
This commit is contained in:
parent
372c85345d
commit
2b62806529
1 changed files with 20 additions and 4 deletions
22
grandbot.py
22
grandbot.py
|
@ -225,30 +225,46 @@ Sintassi: `/cv`"""
|
||||||
for user in channels[channel]:
|
for user in channels[channel]:
|
||||||
# Online status
|
# Online status
|
||||||
if user.status.name == "online":
|
if user.status.name == "online":
|
||||||
|
# Online
|
||||||
status = "🔵"
|
status = "🔵"
|
||||||
elif user.status.name == "dnd":
|
elif user.status.name == "dnd" or user.game.type == 1:
|
||||||
|
# Do not disturb or streaming
|
||||||
status = "🔴"
|
status = "🔴"
|
||||||
elif user.status.name == "idle":
|
elif user.status.name == "idle":
|
||||||
|
# Idle
|
||||||
status = "⚫"
|
status = "⚫"
|
||||||
elif user.status.name == "offline":
|
elif user.status.name == "offline":
|
||||||
|
# Invisible
|
||||||
status = "⚪"
|
status = "⚪"
|
||||||
else:
|
else:
|
||||||
|
# Unknown
|
||||||
status = "❓"
|
status = "❓"
|
||||||
# Voice status
|
# Voice status
|
||||||
if user.bot:
|
if user.bot:
|
||||||
|
# Music bot
|
||||||
volume = "🎵"
|
volume = "🎵"
|
||||||
elif user.voice.deaf or user.voice.self_deaf:
|
elif user.voice.deaf or user.voice.self_deaf:
|
||||||
|
# Deafened
|
||||||
volume = "🔇"
|
volume = "🔇"
|
||||||
elif user.voice.mute or user.voice.self_mute:
|
elif user.voice.mute or user.voice.self_mute:
|
||||||
|
# Muted
|
||||||
volume = "🔈"
|
volume = "🔈"
|
||||||
else:
|
else:
|
||||||
|
# Speaking
|
||||||
volume = "🔊"
|
volume = "🔊"
|
||||||
# Game, is formatted
|
# Game, is formatted
|
||||||
if user.game is not None:
|
if user.game is not None:
|
||||||
|
# Playing
|
||||||
|
if user.game.type == 0:
|
||||||
|
# Game name
|
||||||
game = f"- *{user.game.name}*"
|
game = f"- *{user.game.name}*"
|
||||||
|
# Streaming
|
||||||
|
elif user.game.type == 1:
|
||||||
|
# Stream name and url
|
||||||
|
game = f"- [{user.game.name}]({user.game.url})"
|
||||||
else:
|
else:
|
||||||
game = ""
|
game = ""
|
||||||
# Name
|
# Nickname if available, otherwise use the username
|
||||||
if user.nick is not None:
|
if user.nick is not None:
|
||||||
name = user.nick
|
name = user.nick
|
||||||
else:
|
else:
|
||||||
|
@ -257,7 +273,7 @@ Sintassi: `/cv`"""
|
||||||
to_send += f"{volume} {status} {name} {game}\n"
|
to_send += f"{volume} {status} {name} {game}\n"
|
||||||
# Channel footer
|
# Channel footer
|
||||||
to_send += "\n"
|
to_send += "\n"
|
||||||
await update.message.reply(bot, to_send, parse_mode="Markdown")
|
await update.message.reply(bot, to_send, parse_mode="Markdown", disable_web_page_preview=1)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
# Init Telegram bot commands
|
# Init Telegram bot commands
|
||||||
|
|
Loading…
Reference in a new issue