class Discordrb::Light::Integration
An integration of a connection into a particular server, for example being a member of a subscriber-only Twitch server.
Attributes
integrated_connection[R]
@return [Connection] the connection integrated with the server (i. e. your connection)
server[R]
@return [UltraLightServer] the server associated with this integration
server_connection[R]
@note The connection returned by this method will have no integrations itself, as Discord doesn't provide that
data. Also, it will always be considered not revoked.
@return [Connection] the server's underlying connection (for a Twitch subscriber-only server, it would be the
Twitch account connection of the server owner).
Public Class Methods
new(data, integrated, bot)
click to toggle source
@!visibility private
# File lib/discordrb/light/integrations.rb, line 56 def initialize(data, integrated, bot) @bot = bot @integrated_connection = integrated @server = UltraLightServer.new(data['guild'], bot) # Restructure the given data so we can reuse the Connection initializer restructured = {} restructured['type'] = data['type'] restructured['id'] = data['account']['id'] restructured['name'] = data['account']['name'] restructured['integrations'] = [] @server_connection = Connection.new(restructured, bot) end