Change the presence

A help page for changing the bot's presence

Presence

A bot presence is basically the status of a bot (idle, dnd, online, offline, invisible)

Changing status + activity might doesn't work sometimes!

Directly after startup, the presence is not changeable, it's recommended to put that into a delayed task

How to update the Presence for the Bot

$activity = new Activity();

How to change the action

Set the bot playing

The Gamename can be a various value

$activity->setPlaying("Gamename");

Set the bot listening

The Songname can be a various value

$activity->setListening("Songname");

Set the bot streaming

The streamed game can be a various value

Set the bot competing

The competing game can a various value

How to change the Create - Timestamp

This is not recommended since not every timestamp is going to work, only change the value if you know exactly what you're doing!

$timestamp has to be an Integer

How to change the status

The status can either be online, dnd, idle, invisible or offline

You can change it by using

for this you can also use the constants listed here.

Now, how to actually update the presence?

This is quite simple too, just perform this action:

If you don't know how to get the Client instance visit This page.

Examples:

Last updated