-
Notifications
You must be signed in to change notification settings - Fork 237
Client
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();
-
Guild Repository
$discord->guilds
-
Private Channel Repository
$discord->private_channels
-
User Repository
$discord->users
$discord->username = 'NewBotName';
// To apply the name change in discord server:
$discord->save();
Note: This wiki is currently Work In Progress. Consider reading the docs instead.
- Application Command (Slash based)
Command Client (Message based)
- Activity
- Application
- Guild
- Private Channel
- User
Components
-
ActionRow
- Buttons
- Option (commands)
- SelectMenu
- TextInput
Builders