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

22 lines
550 B
Python
Raw Normal View History

2021-04-19 14:56:36 +00:00
import royalnet.engineer as engi
import royalpack.database as db
import royalpack.bolts as rb
2021-04-30 13:22:58 +00:00
@rb.capture_errors
2021-04-19 14:56:36 +00:00
@engi.use_database(db.lazy_session_class)
@rb.use_ryglogin(allow_anonymous=True)
@engi.TeleportingConversation
async def whoami(*, _msg: engi.Message, _user: db.User, **__):
2021-04-19 14:56:36 +00:00
"""
Scopri con che RYGaccount sei loggato.
2021-04-19 14:56:36 +00:00
"""
if _user:
2021-04-20 00:43:48 +00:00
await _msg.reply(text=f"☀️ Sei loggato come \uE01B{_user.name}\uE00B!")
2021-04-19 14:56:36 +00:00
else:
await _msg.reply(text="☁️ Non hai effettuato il login.")
2021-04-19 14:56:36 +00:00
__all__ = ("whoami",)