2021-04-19 14:56:36 +00:00
|
|
|
import royalnet.engineer as engi
|
2022-03-06 16:48:16 +00:00
|
|
|
|
2021-04-19 14:56:36 +00:00
|
|
|
import royalpack.bolts as rb
|
2022-03-06 16:48:16 +00:00
|
|
|
import royalpack.database as db
|
2021-04-19 14:56:36 +00:00
|
|
|
|
|
|
|
|
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
|
2021-04-19 23:37:06 +00:00
|
|
|
async def whoami(*, _msg: engi.Message, _user: db.User, **__):
|
2021-04-19 14:56:36 +00:00
|
|
|
"""
|
2021-04-19 23:37:06 +00:00
|
|
|
Scopri con che RYGaccount sei loggato.
|
2021-04-19 14:56:36 +00:00
|
|
|
"""
|
|
|
|
|
2021-04-19 23:37:06 +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:
|
2021-04-19 23:37:06 +00:00
|
|
|
await _msg.reply(text="☁️ Non hai effettuato il login.")
|
2021-04-19 14:56:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
__all__ = ("whoami",)
|