Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

canvacord

Package Overview
Dependencies
Maintainers
5
Versions
244
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

canvacord - npm Package Compare versions

Comparing version 5.4.0-dev.1 to 5.4.0

6

libs/Trigger.js

@@ -18,3 +18,3 @@ const Canvas = require("@napi-rs/canvas");

while (i < 9) {
ctx.clearRect(0, 0, 256, 310);
ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.drawImage(

@@ -27,4 +27,2 @@ img,

);
ctx.fillStyle = "#FF000033";
ctx.fillRect(0, 0, 256, 310);
ctx.drawImage(

@@ -37,2 +35,4 @@ base,

);
// ctx.fillStyle = "#FF000011";
// ctx.fillRect(0, 0, 256, 310);
GIF.addFrame(ctx);

@@ -39,0 +39,0 @@ i++;

{
"name": "canvacord",
"version": "5.4.0-dev.1",
"version": "5.4.0",
"description": "Powerful image manipulation package for beginners.",

@@ -55,3 +55,2 @@ "main": "index.js",

"dependencies": {
"@canvacord/emoji-parser": "^1.0.1",
"@napi-rs/canvas": "^0.1.25",

@@ -58,0 +57,0 @@ "@skyra/gifenc": "^1.0.0",

@@ -18,3 +18,3 @@ module.exports = num => {

}
return num;
return `${num}`;
};

@@ -1,5 +0,3 @@

const emoji = require("@canvacord/emoji-parser");
module.exports = async (ctx, message, x, y) => {
return await emoji.fillTextWithTwemoji(ctx, message, x, y);
return ctx.fillText(message, x, y);
};

@@ -7,2 +7,7 @@ const fs = require("fs");

const store = {
fonts: {},
images: {}
};
function loadAssets(warnIfFailed = true) {

@@ -40,2 +45,7 @@ for (const asset of ["fonts", "images"]) {

ensureLoaded();
return store.fonts[name]?.path;
},
getMetadata(name) {
if (!name || typeof name !== "string") throw new TypeError("image name must be a string");
ensureLoaded();
return store.fonts[name];

@@ -52,2 +62,7 @@ },

ensureLoaded();
return store.images[name]?.path;
},
getMetadata(name) {
if (!name || typeof name !== "string") throw new TypeError("image name must be a string");
ensureLoaded();
return store.images[name];

@@ -54,0 +69,0 @@ },

@@ -44,3 +44,2 @@ const Trigger = require("../libs/Trigger");

if (!image) throw new Error("Expected image, received nothing!");
await Canvacord.__wait();
return await Trigger(image, Canvacord.assets.image.get("TRIGGERED"));

@@ -340,3 +339,2 @@ }

if (!image2) throw new Error("Second image was not provided!");
await this.__wait();
const canvas = Canvas.createCanvas(768, 574);

@@ -362,3 +360,3 @@ const ctx = canvas.getContext("2d");

if (!image2) throw new Error("Second image was not provided!");
await this.__wait();
const canvas = Canvas.createCanvas(500, 500);

@@ -382,3 +380,3 @@ const ctx = canvas.getContext("2d");

if (!fontArray.length) {
Canvas.GlobalFonts.loadFontsFromDir(`${Canvacord.assets.ASSETS_DIR}/fonts`)
// Canvas.GlobalFonts.loadFontsFromDir(`${Canvacord.assets.ASSETS_DIR}/fonts`)
Canvas.GlobalFonts.registerFromPath(Canvacord.assets.font.get("MANROPE_BOLD"), "MANROPE_BOLD");

@@ -406,3 +404,3 @@ Canvas.GlobalFonts.registerFromPath(Canvacord.assets.font.get("MANROPE_REGULAR"), "MANROPE_REGULAR");

if (!image2) throw new Error("Second image was not provided!");
await this.__wait();
const canvas = Canvas.createCanvas(1000, 500);

@@ -426,3 +424,3 @@ const ctx = canvas.getContext("2d");

if (!image) throw new Error("Image was not provided!");
await this.__wait();
const img = await Canvas.loadImage(image);

@@ -446,3 +444,3 @@ const base = await Canvas.loadImage(Canvacord.assets.image.get("BEAUTIFUL"));

if (!image) throw new Error("image was not provided!");
await this.__wait();
let layer = await Canvas.loadImage(Canvacord.assets.image.get("FACEPALM"));

@@ -466,3 +464,3 @@ let canvas = Canvas.createCanvas(632, 357);

if (!image) throw new Error("image was not provided!");
await this.__wait();
let bg = await Canvas.loadImage(Canvacord.assets.image.get("GAY"));

@@ -484,3 +482,3 @@ let img = await Canvas.loadImage(image);

if (!image) throw new Error("Image was not provided!");
await this.__wait();
const img = await Canvas.loadImage(image);

@@ -502,3 +500,3 @@ const bg = await Canvas.loadImage(Canvacord.assets.image.get("RIP"));

if (!image) throw new Error("Image was not provided!");
await this.__wait();
const blur = await Canvacord.blur(image);

@@ -522,3 +520,3 @@ const img = await Canvas.loadImage(blur);

if (!image) throw new Error("image was not provided!");
await this.__wait();
const img = await Canvas.loadImage(image);

@@ -563,3 +561,3 @@ const bg = await Canvas.loadImage(Canvacord.assets.image.get("HITLER"));

if (!image) throw new Error("Image wasn ot provided!");
await this.__wait();
const layer = await Canvas.loadImage(Canvacord.assets.image.get("JOKEOVERHEAD"));

@@ -586,3 +584,3 @@ const img = await Canvas.loadImage(image)

if (!image2) throw new Error("Second image was not provided!");
await this.__wait();
const background = await Canvas.loadImage(Canvacord.assets.image.get("DISTRACTED"));

@@ -611,3 +609,3 @@ const avatar1 = await Canvas.loadImage(await Canvacord.circle(image1));

if (!image) throw new Error("image was not provided!");
await this.__wait();
const img = await Canvas.loadImage(image);

@@ -633,3 +631,3 @@ const bg = await Canvas.loadImage(Canvacord.assets.image.get("AFFECT"));

if (!image) throw new Error("image was not provided!");
await this.__wait();
const img = await Canvas.loadImage(greyscale ? await Canvacord.greyscale(image) : image);

@@ -656,3 +654,3 @@ const bg = await Canvas.loadImage(Canvacord.assets.image.get("JAIL"));

if (!image2) throw new Error("Second image was not provided!");
await this.__wait();
const avatar = await Canvas.loadImage(image1);

@@ -682,3 +680,3 @@ const avatar1 = await Canvas.loadImage(image2);

if (!image) throw new Error("image was not provided!");
await this.__wait();
const img = await Canvas.loadImage(image);

@@ -834,3 +832,3 @@ const bg = await Canvas.loadImage(dark ? await Canvacord.invert(Canvacord.assets.image.get("DELETE")) : Canvacord.assets.image.get("DELETE"));

if (!msg) throw new Error("Message was not provided!");
await this.__wait();
const bg = await Canvas.loadImage(Canvacord.assets.image.get("OPINION"));

@@ -884,3 +882,2 @@ const ava = await Canvas.loadImage(avatar);

if (!message) throw new Error("Message was not provided!");
await Canvacord.__wait();
const bg = await Canvas.loadImage(Canvacord.assets.image.get("OHNO"));

@@ -907,3 +904,3 @@ const canvas = Canvas.createCanvas(1000, 1000);

if (!text) throw new Error("missing text!");
await this.__wait();
const base = await Canvas.loadImage(Canvacord.assets.image.get("CHANGEMYMIND"));

@@ -961,3 +958,2 @@ const canvas = Canvas.createCanvas(base.width, base.height);

if (!message) messgae = "Please provide text!";
await this.__wait()
let avatar = await Canvas.loadImage(await Canvacord.circle(Canvacord.assets.image.get("CLYDE")));

@@ -1013,3 +1009,3 @@ let badge = await Canvas.loadImage(Canvacord.assets.image.get("BOTBADGE"));

static async quote(options = { image, message, username, color }) {
await this.__wait();
if (!options.image) options.image = Canvacord.assets.image.get("CLYDE");

@@ -1061,3 +1057,3 @@ if (!options.message) options.message = "Please provide text!";

await this.__wait();
let image = await Canvas.loadImage(options.image);

@@ -1092,3 +1088,3 @@ let baseImage = await Canvas.loadImage(Canvacord.assets.image.get("PHUB"));

if (!image) throw new Error("image was not provided!");
await this.__wait();
const img = await Canvas.loadImage(image);

@@ -1113,3 +1109,3 @@ const bg = await Canvas.loadImage(Canvacord.assets.image.get("WANTED"));

if (!image) throw new Error("image was not provided!");
await this.__wait();
const img = await Canvas.loadImage(await Canvacord.greyscale(image));

@@ -1142,3 +1138,3 @@ const bg = await Canvas.loadImage(Canvacord.assets.image.get("WASTED"));

await this.__wait();
const bg = await Canvas.loadImage(!ops.dark ? Canvacord.assets.image.get("YOUTUBE") : await Canvacord.invert(Canvacord.assets.image.get("YOUTUBE")));

@@ -1181,3 +1177,3 @@ const avatar = await Canvas.loadImage(await Canvacord.circle(ops.avatar));

if (!image) throw new Error("image was not provided!");
await this.__wait();
const img = await Canvas.loadImage(await Canvacord.circle(image));

@@ -1364,13 +1360,2 @@ const bg = await Canvas.loadImage(Canvacord.assets.image.get("SHIT"));

/**
* Canvacord method used to `wait`.
* @param {number} dur Number of milliseconds to wait
* @returns {Promise<void>}
*/
static __wait(dur) {
return new Promise((res) => {
setTimeout(() => res(), dur || 250);
});
}
/**
* Canvacord convolution matrix

@@ -1377,0 +1362,0 @@ * @typedef {object} ConvolutionMatrix

@@ -495,3 +495,3 @@ const Canvas = require("@napi-rs/canvas");

// draw username
ctx.font = `bold ${this.data.fontSize ?? "36px"} ${ops.fontX}`;
ctx.font = `bold 36px ${ops.fontX}`;
ctx.fillStyle = this.data.username.color;

@@ -508,5 +508,5 @@ ctx.textAlign = "start";

if (discrim) {
ctx.font = `${this.data.fontSize ?? "36px"} ${ops.fontY}`;
ctx.font = `36px ${ops.fontY}`;
ctx.fillStyle = this.data.discriminator.color;
ctx.textAlign = "start";
ctx.textAlign = "center";
ctx.fillText(`#${discrim.substr(0, 4)}`, ctx.measureText(name).width + 20 + 335, 164);

@@ -517,7 +517,7 @@ }

if (this.data.level.display && !isNaN(this.data.level.data)) {
ctx.font = `bold ${this.data.fontSize ?? "36px"} ${ops.fontX}`;
ctx.font = `bold 36px ${ops.fontX}`;
ctx.fillStyle = this.data.level.textColor;
ctx.fillText(this.data.level.displayText, 800 - ctx.measureText(Util.toAbbrev(parseInt(this.data.level.data))).width, 82);
ctx.font = `bold ${this.data.fontSize ?? "32px"} ${ops.fontX}`;
ctx.font = `bold 32px ${ops.fontX}`;
ctx.fillStyle = this.data.level.color;

@@ -530,7 +530,7 @@ ctx.textAlign = "end";

if (this.data.rank.display && !isNaN(this.data.rank.data)) {
ctx.font = `bold ${this.data.fontSize ?? "36px"} ${ops.fontX}`;
ctx.font = `bold 36px ${ops.fontX}`;
ctx.fillStyle = this.data.rank.textColor;
ctx.fillText(this.data.rank.displayText, 800 - ctx.measureText(Util.toAbbrev(parseInt(this.data.level.data)) || "-").width - 7 - ctx.measureText(this.data.level.displayText).width - 7 - ctx.measureText(Util.toAbbrev(parseInt(this.data.rank.data)) || "-").width, 82);
ctx.font = `bold ${this.data.fontSize ?? "32px"} ${ops.fontX}`;
ctx.font = `bold 32px ${ops.fontX}`;
ctx.fillStyle = this.data.rank.color;

@@ -542,3 +542,3 @@ ctx.textAlign = "end";

// show progress
ctx.font = `bold ${this.data.fontSize ?? '30px'} ${ops.fontX}`;
ctx.font = `bold 30px ${ops.fontX}`;
ctx.fillStyle = this.data.requiredXP.color;

@@ -545,0 +545,0 @@ ctx.textAlign = "start";

@@ -408,7 +408,2 @@ // generated by JSDOC

/**
* <p>Canvacord method used to <code>wait</code>.</p>
* @param dur - <p>Number of milliseconds to wait</p>
*/
static __wait(dur: number): Promise<void>;
/**
* <p>Matrix data for <strong>Canvacord.convolute()</strong></p>

@@ -415,0 +410,0 @@ */

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc