Module: Discordrb::MemberAttributes
Overview
Mixin for the attributes members and private members should have
Constant Summary collapse
- MEMBER_FLAGS =
Map of server member flags
{ rejoined: 1 << 0, completed_onboarding: 1 << 1, bypassed_verification: 1 << 2, started_onboarding: 1 << 3, guest: 1 << 4, started_home_actions: 1 << 5, completed_home_actions: 1 << 6, automod_quarantined_username: 1 << 7, dm_settings_upsell_acknowledged: 1 << 9 }.freeze
Instance Attribute Summary collapse
-
#boosting_since ⇒ Time?
readonly
When this member boosted this server,
nil
if they haven't. -
#communication_disabled_until ⇒ Time
(also: #timeout)
readonly
When the user's timeout will expire.
-
#flags ⇒ Integer
readonly
The flags set on this member.
-
#joined_at ⇒ Time
readonly
When this member joined the server.
-
#nick ⇒ String?
(also: #nickname)
readonly
The nickname this member has, or
nil
if it has none. -
#pending ⇒ true, false
(also: #pending?)
readonly
Whether the member has not yet passed the server's membership screening requirements.
-
#roles ⇒ Array<Role>
readonly
The roles this member has.
-
#server ⇒ Server
readonly
The server this member is on.
-
#server_avatar_decoration ⇒ AvatarDecoration?
readonly
The user's current server avatar decoration, or nil for no server avatar decoration.
-
#server_avatar_id ⇒ String?
readonly
The ID of this user's current avatar, can be used to generate a server avatar URL.
-
#server_banner_id ⇒ String?
readonly
The ID of this user's current server banner, can be used to generate a banner URL.
Instance Method Summary collapse
-
#server_avatar_url(format = nil) ⇒ String?
Utility method to get a member's server avatar URL.
-
#server_banner_url(format = nil) ⇒ String?
Utility method to get a member's server banner URL.
Instance Attribute Details
#boosting_since ⇒ Time? (readonly)
Returns when this member boosted this server, nil
if they haven't.
23 24 25 |
# File 'lib/discordrb/data/member.rb', line 23 def boosting_since @boosting_since end |
#communication_disabled_until ⇒ Time (readonly) Also known as: timeout
Returns When the user's timeout will expire.
36 37 38 |
# File 'lib/discordrb/data/member.rb', line 36 def communication_disabled_until @communication_disabled_until end |
#flags ⇒ Integer (readonly)
Returns the flags set on this member.
40 41 42 |
# File 'lib/discordrb/data/member.rb', line 40 def flags @flags end |
#joined_at ⇒ Time (readonly)
Returns when this member joined the server.
20 21 22 |
# File 'lib/discordrb/data/member.rb', line 20 def joined_at @joined_at end |
#nick ⇒ String? (readonly) Also known as: nickname
Returns the nickname this member has, or nil
if it has none.
26 27 28 |
# File 'lib/discordrb/data/member.rb', line 26 def nick @nick end |
#pending ⇒ true, false (readonly) Also known as: pending?
Returns whether the member has not yet passed the server's membership screening requirements.
43 44 45 |
# File 'lib/discordrb/data/member.rb', line 43 def pending @pending end |
#roles ⇒ Array<Role> (readonly)
Returns the roles this member has.
30 31 32 |
# File 'lib/discordrb/data/member.rb', line 30 def roles @roles end |
#server ⇒ Server (readonly)
Returns the server this member is on.
33 34 35 |
# File 'lib/discordrb/data/member.rb', line 33 def server @server end |
#server_avatar_decoration ⇒ AvatarDecoration? (readonly)
Returns the user's current server avatar decoration, or nil for no server avatar decoration.
55 56 57 |
# File 'lib/discordrb/data/member.rb', line 55 def server_avatar_decoration @server_avatar_decoration end |
#server_avatar_id ⇒ String? (readonly)
Returns the ID of this user's current avatar, can be used to generate a server avatar URL.
48 49 50 |
# File 'lib/discordrb/data/member.rb', line 48 def server_avatar_id @server_avatar_id end |
#server_banner_id ⇒ String? (readonly)
Returns the ID of this user's current server banner, can be used to generate a banner URL.
52 53 54 |
# File 'lib/discordrb/data/member.rb', line 52 def @server_banner_id end |
Instance Method Details
#server_avatar_url(format = nil) ⇒ String?
Utility method to get a member's server avatar URL.
60 61 62 |
# File 'lib/discordrb/data/member.rb', line 60 def server_avatar_url(format = nil) API::Server.avatar_url(@server_id, @user.id, @server_avatar_id, format) if @server_avatar_id end |