Class: Discordrb::ServerPreview

Inherits:
Object
  • Object
show all
Includes:
IDObject, ServerAttributes
Defined in:
lib/discordrb/data/server_preview.rb

Overview

Publicly accessible information about a discoverable server.

Instance Attribute Summary collapse

Attributes included from ServerAttributes

#icon_id, #name

Attributes included from IDObject

#id

Instance Method Summary collapse

Methods included from ServerAttributes

#icon_url

Methods included from IDObject

#==, #creation_time, synthesise

Instance Attribute Details

#descriptionString? (readonly)



30
31
32
# File 'lib/discordrb/data/server_preview.rb', line 30

def description
  @description
end

#discovery_splash_idString? (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

#emojisHash<Integer => Emoji> (readonly)



18
19
20
# File 'lib/discordrb/data/server_preview.rb', line 18

def emojis
  @emojis
end

#featuresArray<Symbol> (readonly)



21
22
23
# File 'lib/discordrb/data/server_preview.rb', line 21

def features
  @features
end

#member_countInteger (readonly)



24
25
26
# File 'lib/discordrb/data/server_preview.rb', line 24

def member_count
  @member_count
end

#presence_countInteger (readonly)



27
28
29
# File 'lib/discordrb/data/server_preview.rb', line 27

def presence_count
  @presence_count
end

#splash_idString? (readonly)

Returns the ID of the server's invite splash screen.

See Also:



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

#serverServer

Get the server associated with this server preview.

Raises:



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