class Discordrb::Application
OAuth Application
information
Attributes
description[R]
@return [String] the application description
flags[R]
@return [Integer]
name[R]
@return [String] the application name
owner[R]
Gets the user object of the owner. May be limited to username, discriminator, ID, and avatar if the bot cannot reach the owner. @return [User] the user object of the owner
rpc_origins[R]
@return [Array<String>] the application's origins permitted to use RPC
Public Class Methods
new(data, bot)
click to toggle source
# File lib/discordrb/data.rb, line 301 def initialize(data, bot) @bot = bot @name = data['name'] @id = data['id'].to_i @description = data['description'] @icon_id = data['icon'] @rpc_origins = data['rpc_origins'] @flags = data['flags'] @owner = @bot.ensure_user(data['owner']) end
Public Instance Methods
icon_url()
click to toggle source
Utility function to get a application's icon URL. @return [String, nil] the URL of the icon image (nil if no image is set).
# File lib/discordrb/data.rb, line 315 def icon_url return nil if @icon_id.nil? API.app_icon_url(@id, @icon_id) end
inspect()
click to toggle source
The inspect method is overwritten to give more useful output
# File lib/discordrb/data.rb, line 322 def inspect "<Application name=#{@name} id=#{@id}>" end