class Discordrb::Integration

Server integration

Attributes

account[R]

@return [IntegrationAccount] the integration account information

emoticon[R]

@return [true, false] whether emoticons are enabled

emoticon?[R]

@return [true, false] whether emoticons are enabled

enabled[R]

@return [true, false] whether the integration is enabled

expire_behavior[R]

@return [Symbol] the behaviour of expiring subscribers (:remove = Remove User from role; :kick = Kick User from server)

expire_behaviour[R]

@return [Symbol] the behaviour of expiring subscribers (:remove = Remove User from role; :kick = Kick User from server)

expire_grace_period[R]

@return [Integer] the grace period before subscribers expire (in days)

name[R]

@return [String] the integration name

role[R]

@return [Role, nil] the role that this integration uses for “subscribers”

server[R]

@return [Server] the server the integration is linked to

synced_at[R]

@return [Time] the time the integration was synced at

syncing[R]

@return [true, false] whether the integration is syncing

type[R]

@return [String] the integration type (YouTube, Twitch, etc.)

user[R]

@return [User] the user the integration is linked to

Public Class Methods

new(data, bot, server) click to toggle source
# File lib/discordrb/data.rb, line 2840
def initialize(data, bot, server)
  @bot = bot

  @name = data['name']
  @server = server
  @id = data['id'].to_i
  @enabled = data['enabled']
  @syncing = data['syncing']
  @type = data['type']
  @account = IntegrationAccount.new(data['account'])
  @synced_at = Time.parse(data['synced_at'])
  @expire_behaviour = %i[remove kick][data['expire_behavior']]
  @expire_grace_period = data['expire_grace_period']
  @user = @bot.ensure_user(data['user'])
  @role = server.role(data['role_id']) || nil
  @emoticon = data['enable_emoticons']
end

Public Instance Methods

inspect() click to toggle source

The inspect method is overwritten to give more useful output

# File lib/discordrb/data.rb, line 2859
def inspect
  "<Integration name=#{@name} id=#{@id} type=#{@type} enabled=#{@enabled}>"
end