Class: Discordrb::ServerPreview
- Inherits:
-
Object
- Object
- Discordrb::ServerPreview
- Includes:
- IDObject, ServerAttributes
- Defined in:
- lib/discordrb/data/server_preview.rb
Overview
Publicly accessible information about a discoverable server.
Instance Attribute Summary collapse
-
#description ⇒ String?
readonly
The description of this server that's shown in the discovery tab.
-
#discovery_splash_id ⇒ String?
readonly
The ID of the server's discovery splash screen.
-
#emojis ⇒ Hash<Integer => Emoji>
readonly
A hash of all the emojis usable on this server.
-
#features ⇒ Array<Symbol>
readonly
The features of this server, e.g.
-
#member_count ⇒ Integer
readonly
The approximate number of members on this server, offline or not.
-
#presence_count ⇒ Integer
readonly
The approximate number of members that aren't offline on this server.
-
#splash_id ⇒ String?
readonly
The ID of the server's invite splash screen.
Attributes included from ServerAttributes
Attributes included from IDObject
Instance Method Summary collapse
-
#discovery_splash_url(format = 'webp') ⇒ String?
Utility method to get a server preview's discovery splash URL.
-
#server ⇒ Server
Get the server associated with this server preview.
-
#splash_url(format = 'webp') ⇒ String?
Utility method to get a server preview's splash URL.
Methods included from ServerAttributes
Methods included from IDObject
#==, #creation_time, synthesise
Instance Attribute Details
#description ⇒ String? (readonly)
Returns the description of this server that's shown in the discovery tab.
30 31 32 |
# File 'lib/discordrb/data/server_preview.rb', line 30 def description @description end |
#discovery_splash_id ⇒ String? (readonly)
Returns the ID of the server's discovery splash screen.
15 16 17 |
# File 'lib/discordrb/data/server_preview.rb', line 15 def discovery_splash_id @discovery_splash_id end |
#emojis ⇒ Hash<Integer => Emoji> (readonly)
Returns a hash of all the emojis usable on this server.
18 19 20 |
# File 'lib/discordrb/data/server_preview.rb', line 18 def emojis @emojis end |
#features ⇒ Array<Symbol> (readonly)
Returns the features of this server, e.g. :banner
or :verified
.
21 22 23 |
# File 'lib/discordrb/data/server_preview.rb', line 21 def features @features end |
#member_count ⇒ Integer (readonly)
Returns the approximate number of members on this server, offline or not.
24 25 26 |
# File 'lib/discordrb/data/server_preview.rb', line 24 def member_count @member_count end |
#presence_count ⇒ Integer (readonly)
Returns the approximate number of members that aren't offline on this server.
27 28 29 |
# File 'lib/discordrb/data/server_preview.rb', line 27 def presence_count @presence_count end |
#splash_id ⇒ String? (readonly)
Returns the ID of the server's invite splash screen.
11 12 13 |
# File 'lib/discordrb/data/server_preview.rb', line 11 def splash_id @splash_id end |
Instance Method Details
#discovery_splash_url(format = 'webp') ⇒ String?
Utility method to get a server preview's discovery splash URL.
63 64 65 |
# File 'lib/discordrb/data/server_preview.rb', line 63 def discovery_splash_url(format = 'webp') API.discovery_splash_url(@id, @discovery_splash_id, format) if @discovery_splash_id end |
#server ⇒ Server
Get the server associated with this server preview.
49 50 51 |
# File 'lib/discordrb/data/server_preview.rb', line 49 def server @bot.server(@id) end |
#splash_url(format = 'webp') ⇒ String?
Utility method to get a server preview's splash URL.
56 57 58 |
# File 'lib/discordrb/data/server_preview.rb', line 56 def splash_url(format = 'webp') API.splash_url(@id, @splash_id, format) if @splash_id end |