Class: Discordrb::Team

Inherits:
Object
  • Object
show all
Includes:
IDObject
Defined in:
lib/discordrb/data/team.rb

Overview

A group of users that can manage applications.

Defined Under Namespace

Classes: Member

Instance Attribute Summary collapse

Attributes included from IDObject

#id

Instance Method Summary collapse

Methods included from IDObject

#==, #creation_time, synthesise

Instance Attribute Details

#icon_idString? (readonly)

Returns the ID of this team's icon.

Returns:

  • (String, nil)

    the ID of this team's icon.

See Also:



16
17
18
# File 'lib/discordrb/data/team.rb', line 16

def icon_id
  @icon_id
end

#membersArray<Member> (readonly)

Returns the members that are a part of this team.

Returns:

  • (Array<Member>)

    the members that are a part of this team.



19
20
21
# File 'lib/discordrb/data/team.rb', line 19

def members
  @members
end

#nameString (readonly)

Returns the name of this team.

Returns:

  • (String)

    the name of this team.



9
10
11
# File 'lib/discordrb/data/team.rb', line 9

def name
  @name
end

#ownerMember (readonly)

Returns the owner of this team.

Returns:

  • (Member)

    the owner of this team.



12
13
14
# File 'lib/discordrb/data/team.rb', line 12

def owner
  @owner
end

Instance Method Details

#icon_url(format = 'webp') ⇒ String?

Utility method to get a team's icon URL.

Parameters:

  • format (String) (defaults to: 'webp')

    The URL will default to webp. You can otherwise specify one of webp, jpg, or png to override this.

Returns:

  • (String, nil)

    the URL to the icon image (nil if no image is set).



34
35
36
# File 'lib/discordrb/data/team.rb', line 34

def icon_url(format = 'webp')
  API.team_icon_url(@id, @icon_id, format) if @icon_id
end