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

revoked[R]

@return [true, false] has this integration been revoked.

role_id[R]

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

server[R]

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

subscriber_count[R]

@return [Integer, nil] how many subscribers this integration has.

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/integration.rb, line 96
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_id = data['role_id']&.to_i
  @emoticon = data['enable_emoticons']
  @subscriber_count = data['subscriber_count']&.to_i
  @revoked = data['revoked']
  @application = IntegrationApplication.new(data['application'], bot) if data['application']
end

Public Instance Methods

inspect() click to toggle source

The inspect method is overwritten to give more useful output

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