🎶Spotify

Classes

Spotify

Functions

setProgressBar(type, color)Spotify

Set progress bar details

setTitle(title)Spotify

Set title

setImage(source)Spotify

Establecer imagen

setAuthor(name)Spotify

Set the name of the artist

setAlbum(name)Spotify

Set the name of the album

setStartTimestamp(time)Spotify

Set start timestamp

setEndTimestamp(time)Spotify

Set end timestamp

setBackground(type, data)Spotify

Set background image/color of the card

build([font])Promise.<Buffer>

Build the Spotify presence card

Spotify

Kind: global class

new Spotify()

Spotify card creator

PREVIEW

Example

const spotify = new canvacard.Spotify()
  .setAuthor("SAIKO")
  .setAlbum("SAKURA 👋")
  .setStartTimestamp(Date.now() - 10000)
  .setEndTimestamp(Date.now() + 50000)
  .setImage("https://i.scdn.co/image/ab67616d00001e02e346fc6f767ca2ac8365fe60")
  .setTitle("YO LO SOÑÉ");
const spotifyImage = await spotify.build("Cascadia Code PL");
canvacard.write(spotifyImage, "./spotify.png");

setProgressBar(type, color) ⇒ Spotify

Set progress bar details

Kind: global function Returns: Spotify - The current instance of Spotify Throws:

  • APIError Invalid progress bar type

ParamTypeDescription

type

"TRACK" | "BAR"

Type of progress bar

color

string

Color of the progress bar

setTitle(title) ⇒ Spotify

Set title

Kind: global function Returns: Spotify - The current instance of Spotify Throws:

  • APIError Title expected but not received

ParamTypeDescription

title

string

Title of the song

setImage(source) ⇒ Spotify

Establecer imagen

Kind: global function Returns: Spotify - The current instance of Spotify Throws:

  • APIError Image source expected but not received

ParamTypeDescription

source

string | Buffer | Canvas.Image

Fuente de imagen

setAuthor(name) ⇒ Spotify

Set the name of the artist

Kind: global function Returns: Spotify - The current instance of Spotify Throws:

  • APIError Artist name expected but not received

ParamTypeDescription

name

string

Name of the artist

setAlbum(name) ⇒ Spotify

Set the name of the album

Kind: global function Returns: Spotify - The current instance of Spotify Throws:

  • APIError Album name expected but not received

ParamTypeDescription

name

string

Name of the album

setStartTimestamp(time) ⇒ Spotify

Set start timestamp

Kind: global function Returns: Spotify - The current instance of Spotify Throws:

  • APIError Timestamp expected but not received

ParamTypeDescription

time

Date | number

Timestamp

setEndTimestamp(time) ⇒ Spotify

Set end timestamp

Kind: global function Returns: Spotify - The current instance of Spotify Throws:

  • APIError Timestamp expected but not received

ParamTypeDescription

time

Date | number

Timestamp

setBackground(type, data) ⇒ Spotify

Set background image/color of the card

Kind: global function Returns: Spotify - The current instance of Spotify Throws:

  • APIError Missing background data

ParamTypeDescription

type

"COLOR" | "IMAGE"

Type of background

data

string | Buffer | Canvas.Image

Image URL or HTML color code

build([font]) ⇒ Promise.<Buffer>

Build the Spotify presence card

Kind: global function Returns: Promise.<Buffer> - Card image in buffer format Throws:

  • APIError Missing of options

ParamTypeDefaultDescription

[font]

string

"&quot;Arial&quot;"

Font to use in the card

Last updated