-
Notifications
You must be signed in to change notification settings - Fork 238
Channels
Requires the Intents::GUILDS
intent.
Called with a Channel
object when a new channel is created, relevant to the Bot.
$discord->on(Event::CHANNEL_CREATE, function (Channel $channel, Discord $discord) {
// ...
});
Called with two Channel
objects when a channel is updated.
$discord->on(Event::CHANNEL_UPDATE, function (Channel $channel, Discord $discord, ?Channel $oldChannel) {
// ...
});
Called with a Channel
object when a channel relevant to the Bot is deleted.
$discord->on(Event::CHANNEL_DELETE, function (Channel $channel, Discord $discord) {
// ...
});
Called with an object when a message is pinned or unpinned in a text channel. This is not sent when a pinned message is deleted.
$discord->on(Event::CHANNEL_PINS_UPDATE, function ($pins, Discord $discord) {
// {
// "guild_id": "",
// "channel_id": "",
// "last_pin_timestamp": ""
// }
});
For direct messages, it only requires the
Intents::DIRECT_MESSAGES
intent.
Requires the Intents::GUILDS
intent.
Called with a Thread
object when a thread is created, relevant to the Bot.
$discord->on(Event::THREAD_CREATE, function (Thread $thread, Discord $discord) {
// ...
});
Called with a Thread
object when a thread is updated.
$discord->on(Event::THREAD_UPDATE, function (Thread $thread, Discord $discord, ?Thread $oldThread) {
// ...
});
Called with an old Thread
object when a thread relevant to the Bot is deleted.
$discord->on(Event::THREAD_DELETE, function (object $thread, Discord $discord) {
if ($thread instanceof Thread) {
// $thread was cached
}
// $thread was not in cache:
else {
// {
// "type": 0,
// "id": "",
// "guild_id": "",
// "parent_id": ""
// }
}
});
Called when list of threads are synced.
$discord->on(Event::THREAD_LIST_SYNC, function (Collection $threads, Discord $discord) {
// ...
});
Called with a Thread Member
object when the thread member for the current Bot is updated.
// use Discord\Parts\Thread\Member;
$discord->on(Event::THREAD_MEMBER_UPDATE, function (Member $threadMember, Discord $discord) {
// ...
});
Called with a Thread
object when anyone is added to or removed from a thread. If the Bot does not have the Intents::GUILD_MEMBERS
, then this event will only be called if the Bot was added to or removed from the thread.
$discord->on(Event::THREAD_MEMBERS_UPDATE, function (Thread $thread, Discord $discord) {
// ...
});
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