class Discorb::Application

Represents a Discord application.

Attributes

bot_public[R]

@return [Boolean] Whether the application's bot is public.

bot_public?[R]

@return [Boolean] Whether the application's bot is public.

bot_require_code_grant[R]

@return [Boolean] Whether the application's bot requires a code grant.

bot_require_code_grant?[R]

@return [Boolean] Whether the application's bot requires a code grant.

description[R]

@return [String] The application's description.

icon[R]

@return [Discorb::Asset] The application's icon.

id[R]

@return [Discorb::Snowflake] The application's ID.

name[R]

@return [String] The application's name.

owner[R]

@return [Discorb::User] The application's owner.

public?[R]

@return [Boolean] Whether the application's bot is public.

require_code_grant?[R]

@return [Boolean] Whether the application's bot requires a code grant.

summary[R]

@return [String] The application's summary.

team[R]

@return [Discorb::Application::Team] The application's team.

verify_key[R]

@return [String] The application's public key.

Public Class Methods

new(client, data) click to toggle source

@!visibility private

# File lib/discorb/application.rb, line 32
def initialize(client, data)
  @client = client
  @data = data
  @id = Snowflake.new(data[:id])
  @name = data[:name]
  @icon = Asset.new(self, data[:icon])
  @description = data[:description]
  @summary = data[:summary]
  @bot_public = data[:bot_public]
  @bot_require_code_grant = data[:bot_require_code_grant]
  @verify_key = data[:verify_key]
  @owner = @client.users[data[:owner][:id]] || User.new(@client, data[:owner])
  @team = data[:team] && Team.new(@client, data[:team])
end

Public Instance Methods

inspect() click to toggle source
# File lib/discorb/application.rb, line 47
def inspect
  "#<#{self.class} id=#{@id}>"
end