GroupDMChannel
class GroupDMChannel extends DMChannel implements GroupDMChannelInterface (View source)
Represents a Group DM channel.
Traits
Properties
Client | $client | The client which initiated the instance. | from ClientBase |
static Client|null | $serializeClient | The client which will be used to unserialize. | from ClientBase |
protected Collection | $typings | Collection of all typing users (contains arrays). | from TextChannelTrait |
protected array | $typingTriggered | Triggered typings in this channel. | from TextChannelTrait |
protected string|null | $lastMessageID | The last message's ID, or null. | from TextChannelTrait |
StorageInterface | $messages | The storage with all cached messages. | from DMChannel |
string | $id | The channel ID. | from DMChannel |
string|null | $ownerID | The owner ID of this channel, or null. | from DMChannel |
Collection | $recipients | The recipients of this channel, mapped by user ID. | from DMChannel |
int | $createdTimestamp | The timestamp of when this channel was created. | from DMChannel |
DateTime | $createdAt | The DateTime instance of createdTimestamp. | from DMChannel |
User|null | $owner | The owner of this channel, or null. | from DMChannel |
string|null | $applicationID | The application which created the group DM channel. | |
string|null | $icon | The icon of the Group DM channel. |
Methods
No description
No description
Deletes multiple messages at once. Resolves with $this.
Collects messages during a specific duration (and max. amount). Resolves with a Collection of Message instances, mapped by their IDs.
Fetches a specific message using the ID. Resolves with an instance of Message.
Fetches messages of this channel. Resolves with a Collection of Message instances, mapped by their ID.
Gets the last message in this channel if cached, or null.
Sends a message to a channel. Resolves with an instance of Message, or a Collection of Message instances, mapped by their ID.
Starts sending the typing indicator in this channel. Counts up a triggered typing counter.
Stops sending the typing indicator in this channel. Counts down a triggered typing counter.
Determines whether how long the given user has been typing in this channel. Returns -1 if the user is not typing.
Adds the given user to the Group DM channel using the given access token. Resolves with $this.
Returns the group DM's icon URL, or null.
Removes the given user from the Group DM channel. Resolves with $this.
Details
at line 93
mixed
__get(string $name)
in ClientBase at line 67
mixed
jsonSerialize()
in TextChannelTrait at line 42
string
serialize()
in ClientBase at line 89
void
unserialize($data)
at line 105
void
_patch(array $channel)
in ClientBase at line 56
mixed
__debugInfo()
in TextChannelTrait at line 68
ExtendedPromiseInterface
bulkDelete(Collection|array|int $messages, string $reason = '', bool $filterOldMessages = false)
Deletes multiple messages at once. Resolves with $this.
in TextChannelTrait at line 129
ExtendedPromiseInterface
collectMessages(callable $filter, array $options = array())
Collects messages during a specific duration (and max. amount). Resolves with a Collection of Message instances, mapped by their IDs.
Options are as following (all are optional):
array(
'max' => int, (max. messages to collect)
'time' => int, (duration, in seconds, default 30)
'errors' => array, (optional, which failed "conditions" (max not reached in time ("time")) lead to a rejected promise, defaults to [])
)
in TextChannelTrait at line 147
ExtendedPromiseInterface
fetchMessage(string $id)
Fetches a specific message using the ID. Resolves with an instance of Message.
in TextChannelTrait at line 174
ExtendedPromiseInterface
fetchMessages(array $options = array())
Fetches messages of this channel. Resolves with a Collection of Message instances, mapped by their ID.
Options are as following:
array(
'after' => string, (message ID)
'around' => string, (message ID)
'before' => string, (message ID)
'limit' => int, (1-100, defaults to 50)
)
in TextChannelTrait at line 193
Message|null
getLastMessage()
Gets the last message in this channel if cached, or null.
in TextChannelTrait at line 229
ExtendedPromiseInterface
send(string $content, array $options = array())
Sends a message to a channel. Resolves with an instance of Message, or a Collection of Message instances, mapped by their ID.
Options are as following (all are optional):
array(
'embed' => array|\CharlotteDunois\Yasmin\Models\MessageEmbed, (an (embed) array/object or an instance of MessageEmbed)
'files' => array, (an array of `[ 'name' => string, 'data' => string || 'path' => string ]` or just plain file contents, file paths or URLs)
'nonce' => string, (a snowflake used for optimistic sending)
'disableEveryone' => bool, (whether @everyone and @here should be replaced with plaintext, defaults to client option disableEveryone)
'tts' => bool,
'split' => bool|array, (*)
)
* array(
* 'before' => string, (The string to insert before the split)
* 'after' => string, (The string to insert after the split)
* 'char' => string, (The string to split on)
* 'maxLength' => int, (The max. length of each message)
* )
in TextChannelTrait at line 307
void
startTyping()
Starts sending the typing indicator in this channel. Counts up a triggered typing counter.
in TextChannelTrait at line 335
void
stopTyping(bool $force = false)
Stops sending the typing indicator in this channel. Counts down a triggered typing counter.
in TextChannelTrait at line 357
int
typingCount()
Returns the amount of user typing in this channel.
in TextChannelTrait at line 366
bool
isTyping(User $user)
Determines whether the given user is typing in this channel or not.
in TextChannelTrait at line 375
int
isTypingSince(User $user)
Determines whether how long the given user has been typing in this channel. Returns -1 if the user is not typing.
in TextChannelTrait at line 388
Message
_createMessage(array $message)
in TextChannelTrait at line 404
bool
_updateTyping(User $user, int|null $timestamp = null)
bool
isRecipient(User|string $user)
Determines whether a given user is a recipient of this channel.
at line 43
ExtendedPromiseInterface
addRecipient(string|User $user, string $accessToken, string $nick = '')
Adds the given user to the Group DM channel using the given access token. Resolves with $this.
at line 61
string|null
getIconURL(int|null $size = null, string $format = 'png')
Returns the group DM's icon URL, or null.