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