Skip to content
Brandon Cooke edited this page Aug 6, 2019 · 2 revisions

Event

An Event in smash.gg is a broad collection of matches for a single game and game type. For instance, Melee Singles is an Event while Melee Doubles is another Event. Events are comprised of optional Phases and Phases Groups.

const smashgg = require('smashgg.js');
const Event = smashgg.Event;

(async function(){
    let meleeSinglesAtEvo = await Event.get('evo-2017', 'melee-singles');
    let meleeDoublesAtFunction1 = await Event.get('function-1-recursion-regional', 'melee-doubles');
    let sfvAtEvo = await Event.getById(21726);
    let wiiUAtEvo = await Event.getBySlug('tournament/evo-2017/events/super-smash-bros-for-wii-u');

    let phaseGroups = await meleeSinglesAtEvo.getPhaseGroups();
    let sets = sfvAtEvo.getSets();
})();

Constructor

Event(
    id: number ,
    name: string,
    slug: string,
    state: string | null,
    startAt: number | null,
    numEntrants: number | null,
    checkInBuffer: number | null,
    checkInDuration: number | null,
    checkInEnabled: boolean | null,
    isOnline: boolean | null,
    teamNameAllowed: boolean | null,
    teamManagementDeadline: number | null
)

Properties

  • id
    • number
  • name
    • string
  • slug
    • string
  • state
    • string | null
  • startAt
    • number | null
  • numEntrants
    • number | null
  • checkInBuffer
    • number | null
  • checkInDuration
    • number | null
  • checkInEnabled
    • boolean | null
  • isOnline
    • boolean | null
  • teamNameAllowed
    • boolean | null
  • teamManagementDeadline
    • number | null

Statics

  • async get(tournamentSlug, eventSlug)

    • get an event by tournament and event names
    • parameters
      • tournamentSlug
        • string
        • NOTE this is not eligable for shorthand
        • smashgg url slug of the tournament
      • eventSlug
        • string
        • smashgg url slug of the event
    • returns Promise<Event>
  • async getBySlug(slug)

    • get an event by the full slug path
    • parameters
      • slug
        • string
        • tournament + event all-in-one slug
        • ie. tournament/ceo-2017/event/melee-singles
    • returns Promise<Event>
  • async getById(id)

    • get an event by the numeric id
    • parameters
      • id
        • number
        • numeric id of the event
    • returns Promise<Event>

Methods

  • getId()
    • gets the numeric identifier for the event
    • returns number
  • getName()
    • gets the name string for the event
    • returns string
  • getSlug()
    • gets the name url slug for the event
    • returns string
  • getState()
    • gets the state string of the event
    • this is the current state of the event
      • eg: 'COMPLETED'
    • returns string | null
  • getNumEntrants()
    • gets the number of tournament attendees who entered this event
    • returns number | null
  • getCheckInBuffer()
    • gets the amount of time before check in begins
    • returns number | null
  • getCheckInDuration()
    • gets the amount of time check in will last
    • returns number | null
  • getCheckInEnabled()
    • gets the true/false value for if event is doing check-in
    • returns boolean | null
  • getIsOnline()
    • gets the true/false value for if the event is Online
    • returns boolean | null
  • getTeamNameAllowed()
    • gets the true/false value for if the event allows team names
    • returns boolean | null
  • getTeamManagementDeadline()
    • gets the true/false value for if the event has a team management deadline
    • returns number | null

Aggregations

  • getPhases()
    • gets the Phase objects owned by this Event
    • returns Promise<Phase[]>
  • getPhaseGroups()
    • gets the Phase Group that occurred in this event
    • returns Promise<PhaseGroup[]>
  • getStandings(options: IStandings.StandingsOptions)
    • gets the final standings for a given event
    • parameters
    • returns Promise<Standings[]>
  • getEntrants(options: IEntrant.EntrantOptions)
    • gets the tournament attendees who competed in this event
    • parameters
      • options
    • returns Promise<Entrant[]>
  • getAttendees(options: IAttendee.AttendeeOptions)
    • gets the tournament attendees who are in this event
    • parameters
      • options
    • returns Promise<Attendee[]>
  • getSets(options: IGGSet.SetOptions)
    • gets the tournament sets that occurred in this event
    • parameters
      • options
        • SetOptions
        • series of options for the return set of GGSets
    • returns Promise<GGSet[]>
  • getIncompleteSets(options: IGGSet.SetOptions)
    • gets the tournament sets in this event that have yet to be completed
    • parameters
      • options
        • SetOptions
        • series of options for the return set of GGSets
    • returns Promise<GGSet[]>
  • getCompleteSets(options: IGGSet.SetOptions)
    • gets the tournament sets in this event that have been completed
    • parameters
      • options
        • SetOptions
        • series of options for the return set of GGSets
    • returns Promise<GGSet[]>
  • getSetsXMinutesBack(minutesBack: number, options: IGGSet.SetOptions)
    • gets the tournament sets in this event that were completed x minutes ago
    • parameters
      • minutesBack
        • number
        • how many minutes ago do you want to search for completed sets
      • options
        • SetOptions
        • series of options for the return set of GGSets
    • returns Promise<GGSet[]>