2021-04-19 14:56:36 +00:00
|
|
|
import royalnet.engineer as engi
|
|
|
|
import royalpack.database as db
|
|
|
|
import royalpack.bolts as rb
|
|
|
|
|
|
|
|
|
|
|
|
@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
|
|
|
"""
|
|
|
|
|
|
|
|
# TODO: improve output
|
2021-04-19 23:37:06 +00:00
|
|
|
if _user:
|
|
|
|
await _msg.reply(text=f"☀️ {_user.name}")
|
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",)
|