🪄
Canvacard
  • 🥳Welcome
  • 🗂️Classes
    • 🎨Welcome / Leave
    • 🎮FortniteShop
    • 🎯Canvacard
    • 🎶Spotify
    • 🏆Rank
    • 🖋️Plugins
  • 🧰Utils
    • 🔧Abbreviate
    • 🖼️Canvas
    • 🕒Discord Time
    • ⚠️Error
    • 🏳️Flags
    • 🔍Format and Validate Hex
    • ⏰Format Time
    • 📏Format Variable
    • 📅Get Date or String
    • 🔍Icon
    • 🔢Is Number
    • 🔤Is String
    • 🖼️Parse Image
    • 📄Parse PNG
    • 📄Parse SVG
    • 🔽Shorten
    • ✂️Truncate Text
    • 👤Username
Powered by GitBook
On this page
  • Classes
  • Functions
  • Spotify
  • setProgressBar(type, color) ⇒ Spotify
  • setTitle(title) ⇒ Spotify
  • setImage(source) ⇒ Spotify
  • setAuthor(name) ⇒ Spotify
  • setAlbum(name) ⇒ Spotify
  • setStartTimestamp(time) ⇒ Spotify
  • setEndTimestamp(time) ⇒ Spotify
  • setBackground(type, data) ⇒ Spotify
  • build([font]) ⇒ Promise.<Buffer>
  1. Classes

Spotify

PreviousCanvacardNextRank

Last updated 6 months ago

Classes

Functions

⇒

Set progress bar details

⇒

Set title

⇒

Establecer imagen

⇒

Set the name of the artist

⇒

Set the name of the album

⇒

Set start timestamp

⇒

Set end timestamp

Set background image/color of the card

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");

Set progress bar details

  • APIError Invalid progress bar type

Param
Type
Description

type

"TRACK" | "BAR"

Type of progress bar

color

string

Color of the progress bar

Set title

  • APIError Title expected but not received

Param
Type
Description

title

string

Title of the song

Establecer imagen

  • APIError Image source expected but not received

Param
Type
Description

source

string | Buffer | Canvas.Image

Fuente de imagen

Set the name of the artist

  • APIError Artist name expected but not received

Param
Type
Description

name

string

Name of the artist

Set the name of the album

  • APIError Album name expected but not received

Param
Type
Description

name

string

Name of the album

Set start timestamp

  • APIError Timestamp expected but not received

Param
Type
Description

time

Date | number

Timestamp

Set end timestamp

  • APIError Timestamp expected but not received

Param
Type
Description

time

Date | number

Timestamp

Set background image/color of the card

  • APIError Missing background data

Param
Type
Description

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

Param
Type
Default
Description

[font]

string

"&quot;Arial&quot;"

Font to use in the card

⇒

⇒ Promise.<Buffer>

setProgressBar(type, color) ⇒

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

setTitle(title) ⇒

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

setImage(source) ⇒

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

setAuthor(name) ⇒

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

setAlbum(name) ⇒

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

setStartTimestamp(time) ⇒

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

setEndTimestamp(time) ⇒

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

setBackground(type, data) ⇒

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

🗂️
🎶
Spotify
setProgressBar(type, color)
Spotify
setTitle(title)
Spotify
setImage(source)
Spotify
setAuthor(name)
Spotify
setAlbum(name)
Spotify
setStartTimestamp(time)
Spotify
setEndTimestamp(time)
Spotify
setBackground(type, data)
Spotify
build([font])
Spotify
Spotify
Spotify
Spotify
Spotify
Spotify
Spotify
Spotify
Spotify
Spotify
Spotify
Spotify
Spotify
Spotify
Spotify
Spotify