async def change_presence(self, *, activity=None, status=None, afk=False, shard_id=None):
if status is None:<EOL><INDENT>status = '<STR_LIT>'<EOL>status_enum = Status.online<EOL><DEDENT>elif status is Status.offline:<EOL><INDENT>status = '<STR_LIT>'<EOL>status_enum = Status.offline<EOL><DEDENT>else:<EOL><INDENT>status_enum = status<EOL>status = str(status)<EOL><DEDENT>if shard_id is None:<EOL><INDENT>for shard in self.shards.values():<EOL><INDENT>await shard.ws.change_presence(activity=activity, status=status, afk=afk)<EOL><DEDENT>guilds = self._connection.guilds<EOL><DEDENT>else:<EOL><INDENT>shard = self.shards[shard_id]<EOL>await shard.ws.change_presence(activity=activity, status=status, afk=afk)<EOL>guilds = [g for g in self._connection.guilds if g.shard_id == shard_id]<EOL><DEDENT>for guild in guilds:<EOL><INDENT>me = guild.me<EOL>if me is None:<EOL><INDENT>continue<EOL><DEDENT>me.activities = (activity,)<EOL>me.status = status_enum<EOL><DEDENT>
|coro|

        Changes the client's presence.

        The activity parameter is a :class:`Activity` object (not a string) that represents
        the activity being done currently. This could also be the slimmed down versions,
        :class:`Game` and :class:`Streaming`.

        Example: ::

            game = discord.Game("with the API")
            await client.change_presence(status=discord.Status.idle, activity=game)

        Parameters
        ----------
        activity: Optional[Union[:class:`Game`, :class:`Streaming`, :class:`Activity`]]
            The activity being done. ``None`` if no currently active activity is done.
        status: Optional[:class:`Status`]
            Indicates what status to change to. If None, then
            :attr:`Status.online` is used.
        afk: :class:`bool`
            Indicates if you are going AFK. This allows the discord
            client to know how to handle push notifications better
            for you in case you are actually idle and not lying.
        shard_id: Optional[:class:`int`]
            The shard_id to change the presence to. If not specified
            or ``None``, then it will change the presence of every
            shard the bot can see.

        Raises
        ------
        InvalidArgument
            If the ``activity`` parameter is not of proper type.