spcanvas
v1.0.0
Published
Make configurable canvas easily with spcanvas
Downloads
47
Maintainers
Readme
spcanvas
Make configurable canvas easily with spcanvas
Installation
npm i spcanvas
Documentation
Example of code (Discord.js v14)
const spcanvas = require("spcanvas");
const { Client, GatewayIntentBits } = require("discord.js");
const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMembers, GatewayIntentBits.Presences, GatewayIntentBits.Messages] });
client.on("ready", () => {
console.log(`I connect to ${client.user.tag}`)
});
client.on("messageCreate", async message => {
if (message.content === "!spotify") {
const spotify = await new spcanvas.Spotify()
.setAuthor("Alan Walker, Ava Max")
.setAlbum("Alan Walker Album")
.setBackground("image", "https://th.bing.com/th/id/R.0bbabe949adc2ea6c853eddad2f38519?rik=jshX8YIYBDnF4w&pid=ImgRaw&r=0")
.setImage("https://i.scdn.co/image/ab67616d00001e02df9a35baaa98675256b35177")
.setTimestamp(40000, 179000)
.setTitle("Alone, Pt II")
.build();
message.reply({
files: [{
attachment: spotify.toBuffer(),
name: `spotify-${message.member.id}.png`
}]
});
}
});
Note
This package is the continuation of discanvas package