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, automod_quarantined_server_tag: 1 << 10 }.freeze
Instance Attribute Summary collapse
-
#boosting_since ⇒ Time?
readonly
When this member boosted this server,
nilif 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
nilif 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.
24 25 26 |
# File 'lib/discordrb/data/member.rb', line 24 def boosting_since @boosting_since end |
#communication_disabled_until ⇒ Time (readonly) Also known as: timeout
Returns When the user's timeout will expire.
37 38 39 |
# File 'lib/discordrb/data/member.rb', line 37 def communication_disabled_until @communication_disabled_until end |
#flags ⇒ Integer (readonly)
Returns the flags set on this member.
41 42 43 |
# File 'lib/discordrb/data/member.rb', line 41 def flags @flags end |
#joined_at ⇒ Time (readonly)
Returns when this member joined the server.
21 22 23 |
# File 'lib/discordrb/data/member.rb', line 21 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.
27 28 29 |
# File 'lib/discordrb/data/member.rb', line 27 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.
44 45 46 |
# File 'lib/discordrb/data/member.rb', line 44 def pending @pending end |
#roles ⇒ Array<Role> (readonly)
Returns the roles this member has.
31 32 33 |
# File 'lib/discordrb/data/member.rb', line 31 def roles @roles end |
#server ⇒ Server (readonly)
Returns the server this member is on.
34 35 36 |
# File 'lib/discordrb/data/member.rb', line 34 def server @server end |
#server_avatar_decoration ⇒ AvatarDecoration? (readonly)
Returns the user's current server avatar decoration, or nil for no server avatar decoration.
56 57 58 |
# File 'lib/discordrb/data/member.rb', line 56 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.
49 50 51 |
# File 'lib/discordrb/data/member.rb', line 49 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.
53 54 55 |
# File 'lib/discordrb/data/member.rb', line 53 def @server_banner_id end |
Instance Method Details
#server_avatar_url(format = nil) ⇒ String?
Utility method to get a member's server avatar URL.
61 62 63 |
# File 'lib/discordrb/data/member.rb', line 61 def server_avatar_url(format = nil) API::Server.avatar_url(@server_id, @user.id, @server_avatar_id, format) if @server_avatar_id end |