1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00
royalnet/royalpack/commands/version.py

33 lines
1.1 KiB
Python
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import royalnet.engineer as engi
import royalnet_telethon as rt
import royalnet_discordpy as rd
import pkg_resources
import royalpack.bolts as rb
@rb.capture_errors
@engi.TeleportingConversation
async def version(*, _imp: engi.PDAImplementation, _msg: engi.Message, **__):
"""
Controlla la versione attuale dei pacchetti di questo bot.
"""
# noinspection PyListCreation
msg = [
f" \uE01BVersioni\uE00B",
]
msg.append("")
msg.append(f"- \uE01Croyalnet\uE00C \uE01B{pkg_resources.get_distribution('royalnet').version}\uE00B")
if isinstance(_imp, rt.TelethonPDAImplementation):
msg.append(f"- \uE01Croyalnet_telethon\uE00C \uE01B{pkg_resources.get_distribution('royalnet_telethon').version}\uE00B")
elif isinstance(_imp, rd.DiscordpyPDAImplementation):
msg.append(f"- \uE01Croyalnet_discordpy\uE00C \uE01B{pkg_resources.get_distribution('royalnet_discordpy').version}\uE00B")
msg.append(f"- \uE01Croyalpack\uE00C \uE01B{pkg_resources.get_distribution('royalpack').version}\uE00B")
await _msg.reply(text="\n".join(msg))
__all__ = ("version",)