Skip to content
SQKo edited this page Oct 22, 2023 · 3 revisions

Client is your Discord BOT.

use Discord\Parts\User\Client;

The client is the main interface for the client. Most calls on the main class are forwarded here.

Accessing client properties and methods can be done simply with the $discord object.

Saves the client Part. Call this function after you are modifying the client attributes to apply the change.

function save() : ExtendedPromiseInterface

API Documentation: https://discord.com/developers/docs/resources/user#modify-current-user

Return

  • ExtendedPromiseInterface

Example

$discord->save()->then(function () {
    echo 'Bot data updated!';
})->done();

Sets the Bot avatar.

function setAvatar(string $filepath) : bool

Return

  • bool true on success

Example

$discord->setAvatar('/path/to/file');

// To apply the avatar change in Discord:
$discord->save();

Set a new username for the bot

$discord->username = 'NewBotName';

// To apply the name change in discord server:
$discord->save();
Clone this wiki locally