GuildMember
class GuildMember extends ClientBase (View source)
Represents a guild member.
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 |
Guild | $guild | The guild this member belongs to. | |
string | $id | The ID of the member. | |
string|null | $nickname | The nickname of the member, or null. | |
string|null | $avatar | The hash of the user's server avatar, or null. | |
string|null | $banner | The hash of the user's server banner, or null. | |
bool | $deaf | Whether the member is server deafened. | |
bool | $mute | Whether the member is server muted. | |
bool | $selfDeaf | Whether the member is locally deafened. | |
bool | $selfMute | Whether the member is locally muted. | |
bool | $suppress | Whether you suppress the member. | |
string|null | $voiceChannelID | The ID of the voice channel the member is in, or null. | |
string | $voiceSessionID | The voice session ID, or null. | |
int | $joinedTimestamp | The timestamp of when this member joined. | |
Collection | $roles | A Collection of all roles the member has, mapped by their ID. ({see \CharlotteDunois\Yasmin\Models\Role}) | |
string | $displayName | The displayed name. | |
DateTime | $joinedAt | An DateTime instance of joinedTimestamp. | |
Permissions | $permissions | The permissions of the member, only taking roles into account. | |
Presence|null | $presence | The presence of the member in this guild, or null. | |
User|null | $user | The User instance of the member. This should never be null, unless you fuck up. | |
VoiceChannel|null | $voiceChannel | The voice channel the member is in, if connected to voice, or null. |
Methods
No description
No description
Adds roles to the guild member. Resolves with $this.
Bans the guild member.
Edits the guild member. Resolves with $this.
Get the guild avatar URL.
Get the URL of the displayed avatar.
Get the guild banner URL. Currently not exposed to bots.
Get the URL of the displayed banner. Currently not exposed to bots.
Gets the role the member is displayed with.
Gets the displayed color of the member.
Gets the displayed color of the member as hex string.
Gets the highest role of the member.
Gets the role the member is hoisted with.
Whether the member can be banned by the client user.
Whether the member can be kicked by the client user.
Kicks the guild member.
Returns permissions for a member in a guild channel, taking into account roles and permission overwrites.
Removes a role from the guild member. Resolves with $this.
Removes roles from the guild member. Resolves with $this.
Deafen/undeafen a guild member. Resolves with $this.
Mute/unmute a guild member. Resolves with $this.
Set the nickname of the guild member. Resolves with $this.
Sets the roles of the guild member. Resolves with $this.
Moves the guild member to the given voice channel, if connected to voice. Resolves with $this.
The internal hook for cloning.
Automatically converts to a mention.
No description
Details
at line 144
mixed
__get(string $name)
in ClientBase at line 67
mixed
jsonSerialize()
in ClientBase at line 78
string
serialize()
in ClientBase at line 89
void
unserialize($data)
at line 621
void
_patch(array $data)
in ClientBase at line 56
mixed
__debugInfo()
at line 188
ExtendedPromiseInterface
addRole(Role|string $role, string $reason = '')
Adds a role to the guild member. Resolves with $this.
at line 206
ExtendedPromiseInterface
addRoles(array|Collection $roles, string $reason = '')
Adds roles to the guild member. Resolves with $this.
at line 221
ExtendedPromiseInterface
ban(int $days = 0, string $reason = '')
Bans the guild member.
at line 245
ExtendedPromiseInterface
edit(array $options, string $reason = '')
Edits the guild member. Resolves with $this.
Options are as following (only one required):
array(
'nick' => string,
'roles' => array|\CharlotteDunois\Collect\Collection, (of role instances or role IDs)
'deaf' => bool,
'mute' => bool,
'channel' => \CharlotteDunois\Yasmin\Models\VoiceChannel|string|null (will move the member to that channel, if member is connected to voice)
)
at line 282
string|null
getGuildAvatarURL(int|null $size = 1024, string $format = '')
Get the guild avatar URL.
at line 305
string
getDisplayAvatarURL(int|null $size = 1024, string $format = '')
Get the URL of the displayed avatar.
at line 316
string|null
getGuildBannerURL(int|null $size = 1024, string $format = '')
Get the guild banner URL. Currently not exposed to bots.
at line 339
string|null
getDisplayBannerURL(int|null $size = 1024, string $format = '')
Get the URL of the displayed banner. Currently not exposed to bots.
at line 369
int|null
getDisplayColor()
Gets the displayed color of the member.
at line 382
string|null
getDisplayHexColor()
Gets the displayed color of the member as hex string.
at line 431
bool
isBannable()
Whether the member can be banned by the client user.
at line 448
bool
isKickable()
Whether the member can be kicked by the client user.
at line 466
ExtendedPromiseInterface
kick(string $reason = '')
Kicks the guild member.
at line 480
Permissions
permissionsIn(GuildChannelInterface|string $channel)
Returns permissions for a member in a guild channel, taking into account roles and permission overwrites.
at line 495
ExtendedPromiseInterface
removeRole(Role|string $role, string $reason = '')
Removes a role from the guild member. Resolves with $this.
at line 513
ExtendedPromiseInterface
removeRoles(Collection|array $roles, string $reason = '')
Removes roles from the guild member. Resolves with $this.
at line 531
ExtendedPromiseInterface
setDeaf(bool $deaf, string $reason = '')
Deafen/undeafen a guild member. Resolves with $this.
at line 541
ExtendedPromiseInterface
setMute(bool $mute, string $reason = '')
Mute/unmute a guild member. Resolves with $this.
at line 551
ExtendedPromiseInterface
setNickname(string $nickname, string $reason = '')
Set the nickname of the guild member. Resolves with $this.
at line 569
ExtendedPromiseInterface
setRoles(Collection|Role> $roles, string $reason = '')
Sets the roles of the guild member. Resolves with $this.
at line 582
ExtendedPromiseInterface
setVoiceChannel(VoiceChannel|string|null $channel, string $reason = '')
Moves the guild member to the given voice channel, if connected to voice. Resolves with $this.
If the member is connected to a voice channel and the new channel is null, then the member will be disconnected.
at line 591
void
__clone()
The internal hook for cloning.
at line 599
string
__toString()
Automatically converts to a mention.