DiscordPHP-MTG Documentation

BoosterMessageBuilder extends MessageBuilder
in package

An opened booster pack as a Components V2 message: every card with its rarity, foil and price, the pack's value, a picker to look at a card, and buttons to see the pack's images or open another.

Custom ids (Boosters module): pack:open:<set>:<type>, pack:images:<pack>, pack:card:<pack> (the picker, valued with a uuid), where <pack> is the opened pack's id in the search cache.

Tags
since
1.1.0

Table of Contents

Constants

ACCENT  : int = 0xc77d2e
The accent color of booster messages.
GALLERY_SIZE  : int = 10
Images in one media gallery, at most.
PREFIX  : string = 'pack'
The custom id prefix of booster components.

Methods

images()  : static
The pack's card images, ten to a gallery.
line()  : string
One card of the pack: rarity, name, mana cost, foil, price.
pack()  : static
The opened pack.
value()  : float|null
The pack's TCGplayer value, or null when no card in it has a price.

Constants

Methods

images()

The pack's card images, ten to a gallery.

public static images(string $title, array<string|int, Card> $cards) : static
Parameters
$title : string
$cards : array<string|int, Card>
Return values
static

line()

One card of the pack: rarity, name, mana cost, foil, price.

public static line(MTG $mtg, Card $card) : string
Parameters
$mtg : MTG
$card : Card
Return values
string

pack()

The opened pack.

public static pack(MTG $mtg, string $code, string $setName, string $type, array<string|int, Card> $cards, string $pack) : static
Parameters
$mtg : MTG
$code : string

The set code.

$setName : string
$type : string

The booster type.

$cards : array<string|int, Card>

The pack, in MTGJSON's sheet order.

$pack : string

The pack's id in the search cache.

Return values
static

value()

The pack's TCGplayer value, or null when no card in it has a price.

public static value(array<string|int, Card> $cards) : float|null
Parameters
$cards : array<string|int, Card>
Return values
float|null
On this page

Search results