There is no longer a need for the to_user() coroutine, as the author's username has now already been passed with msg.author
Another example:
async def run(client, msg, args):
author = await msg.author.to_user()
await msg.chatroom.send(f"@{author.username} Your balance is {await fetch_user_balance(kick_id=msg.author.id)} coins.")
In commands, you can omit the to_user() coroutine when quickly replying to a message. Performing .replace('-', '_') on msg.author.slug is also not preferred for the sake of prettier and more accurate user-facing usernames.
Quality of life change for quickly pulling the actual username of a user.
For instance, in the use case of chat logging:
There is no longer a need for the
to_user()
coroutine, as the author's username has now already been passed withmsg.author
Another example:
In commands, you can omit the
to_user()
coroutine when quickly replying to a message. Performing.replace('-', '_')
onmsg.author.slug
is also not preferred for the sake of prettier and more accurate user-facing usernames.