Function getPlayerFromIdOrName

Get both the name and id of a player from either their name or id

Id or name of player

Pass "throw" to throw an error if the player is not found, or "return-null" to return null

Object containing id and name of player if it exists, or handles according to onMissing

  • Get both the name and id of a player from either their name or id

    Parameters

    • idOrName: string | number

      Id or name of player

    • OptionalonMissing: "throw"

      Pass "throw" or omit to throw an error if the player is not found

    Returns Player

    Object containing id and name of player

    Throws an error if the player is not found

  • Get both the name and id of a player from either their name or id

    Parameters

    • idOrName: string | number

      Id or name of player

    • onMissing: "throw" | "return-null"

      Pass "return-null" to return null if the player is not found

    Returns Player | null

    Object containing id and name of player if it exists, or handles according to onMissing