Class: Discordrb::Profile
Overview
This class is a special variant of User that represents the bot's user profile (things like own username and the avatar). It can be accessed using Bot#profile.
Constant Summary
Constants included from UserAttributes
Instance Attribute Summary
Attributes inherited from User
#activities, #client_status, #status
Attributes included from UserAttributes
#avatar_decoration, #avatar_id, #bot_account, #collectibles, #discriminator, #global_name, #primary_server, #public_flags, #system_account, #username, #webhook_account
Attributes included from IDObject
Instance Method Summary collapse
- 
  
    
      #avatar=(avatar)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Changes the bot's avatar.
 - 
  
    
      #banner=(banner)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Changes the bot's banner.
 - 
  
    
      #current_bot?  ⇒ true 
    
    
  
  
  
  
  
  
  
  
  
    
Whether or not the user is the bot.
 - 
  
    
      #inspect  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
The inspect method is overwritten to give more useful output.
 - 
  
    
      #username=(username)  ⇒ Object 
    
    
      (also: #name=)
    
  
  
  
  
  
  
  
  
  
    
Sets the bot's username.
 
Methods inherited from User
#await, #await!, #banner_id, #dnd?, #game, #idle?, #offline?, #on, #online?, #pm, #send_file, #stream_type, #stream_url
Methods included from UserAttributes
#avatar_url, #banner_url, #display_name, #distinct, #mention
Methods included from IDObject
#==, #creation_time, synthesise
Instance Method Details
#avatar=(avatar) ⇒ Object
Changes the bot's avatar.
      24 25 26 27 28 29 30  | 
    
      # File 'lib/discordrb/data/profile.rb', line 24 def avatar=(avatar) if avatar.respond_to?(:read) update_profile_data(avatar: Discordrb.encode64(avatar)) else update_profile_data(avatar: avatar) end end  | 
  
#banner=(banner) ⇒ Object
Changes the bot's banner.
      35 36 37 38 39 40 41  | 
    
      # File 'lib/discordrb/data/profile.rb', line 35 def () if .respond_to?(:read) update_profile_data(banner: Discordrb.encode64()) else update_profile_data(banner: ) end end  | 
  
#current_bot? ⇒ true
Whether or not the user is the bot. The Profile can only ever be the bot user, so this always returns true.
      9 10 11  | 
    
      # File 'lib/discordrb/data/profile.rb', line 9 def current_bot? true end  | 
  
#inspect ⇒ Object
The inspect method is overwritten to give more useful output
      53 54 55  | 
    
      # File 'lib/discordrb/data/profile.rb', line 53 def inspect "<Profile user=#{super}>" end  | 
  
#username=(username) ⇒ Object Also known as: name=
Sets the bot's username.
      15 16 17  | 
    
      # File 'lib/discordrb/data/profile.rb', line 15 def username=(username) update_profile_data(username: username) end  |