Skip to content

Instantly share code, notes, and snippets.

@an0ndev
Last active April 2, 2021 00:25
Show Gist options
  • Select an option

  • Save an0ndev/c173c590565a9153a640c7a5e63991b9 to your computer and use it in GitHub Desktop.

Select an option

Save an0ndev/c173c590565a9153a640c7a5e63991b9 to your computer and use it in GitHub Desktop.
Change the status of a userbot with discord.py
async def userbot_change_status (client, *, text, emoji = None):
"""|coro|
Changes a userbot's status.
Example
---------
.. code-block:: python3
client = discord.Client ("token", bot = False) # shh...
await userbot_change_status (client, text = "ToS is gone", emoji = "🥳")
Parameters
----------
client: :class:`.Client`
The client representing the userbot to change the status of.
text: :class:`str`
The text of the status.
emoji: Optional[:class:`str`]
The emoji displayed before the status.
If ``None``, no emoji is displayed.
"""
route = discord.http.Route ("PATCH", "/users/{user_id}/settings", user_id = "@me")
payload = {"custom_status": {"text": text}}
if emoji is not None: payload ["custom_status"] ["emoji_name"] = emoji
await client.http.request (route, reason = None, json = payload)
@an0ndev
Copy link
Author

an0ndev commented Apr 2, 2021

@Rapptz might be useful? not sure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment