Skip to content

Commit

Permalink
Name change
Browse files Browse the repository at this point in the history
  • Loading branch information
flameface committed Nov 12, 2023
1 parent bd898d1 commit e858425
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 36 deletions.
63 changes: 44 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,72 @@
<div>
<img src="https://s6.imgcdn.dev/ZFCbv.png">
<br>
<br>
</div>

# **About**
Pixelord is a powerful canvas project with high-quality design that has awesome canvas like welcomeCard and more in the future.

- Fully Customizable
- High Quality Assets
- Dreamlike designs
**Greetify** is futuristic welcome card canvas library

# **Installation**
```
npm i pixelord
npm i greetify
```

# **Example Usage**
This example code will create a welcome card and save it as a png.
```js
(async () => {
const { welcomeCard } = require("pixelord");
// Importing modules
const { welcomeCard } = require("greetify");
const fs = require("fs")

const welcard = new welcomeCard()
// Card details here
const card = new welcomeCard()
.setName("FlameFace")
.setAvatar("https://s6.imgcdn.dev/ZFQlq.png")
.setMessage("YOU ARE 688 MEMBER")
.setBackground("https://s6.imgcdn.dev/ZqH2S.png")
.setColor("00FF38") // without #
.setTitle("Welcome")

const output = await welcard.build();
// Building process
const output = await card.build();

// Save as image
fs.writeFileSync("card.png", output);
console.log("Done");
})()
```

This example is of **Discord Bot** using discord.js
```js
// Importing modules
const { welcomeCard } = require("greetify");
const { AttachmentBuilder } = require("discord.js")

// Make sure to define client
client.on('guildMemberAdd', async (member) => {
// Card details here
const card = new welcomeCard()
.setName("FlameFace")
.setAvatar("https://s6.imgcdn.dev/ZFQlq.png")
.setMessage("YOU ARE 688 MEMBER")
.setBackground("https://s6.imgcdn.dev/ZqH2S.png")
.setColor("00FF38") // without #
.setTitle("Welcome")

// Building process
const output = await card.build()

// Fetch channel from members guild using ID
const channel = member.guild.channels.cache.get("0000000000000000000");

// Sends card to the "channel"
await channel.send({
files: [{
attachment: output,
name: `${member.id}.png`
}]
})
})
```

### **Output**
![welcome-preview](https://s6.imgcdn.dev/ZFifB.png)

# **Help**
If you need help or want some features to be added, join our official **[A3PIRE](https://discord.gg/qDysF95NWh)** community.


**A3PIRE Project 2023**
If you need help or want some features to be added, join our official **[A3PIRE](https://discord.gg/qDysF95NWh)** community.
4 changes: 2 additions & 2 deletions build/structures/welcomeCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ const { createCanvas, loadImage, GlobalFonts } = require("@napi-rs/canvas");
// GlobalFonts.registerFromPath("build/structures/font/Montserrat-Black.ttf", "montserrat-black")
// GlobalFonts.registerFromPath("build/structures/font/Montserrat-ExtraLight.ttf", "montserrat-extra-light")

GlobalFonts.registerFromPath("node_modules/pixelord/build/structures/font/Montserrat-Black.ttf", "montserrat-black")
GlobalFonts.registerFromPath("node_modules/pixelord/build/structures/font/Montserrat-ExtraLight.ttf", "montserrat-extra-light")
GlobalFonts.registerFromPath("node_modules/greetify/build/structures/font/Montserrat-Black.ttf", "montserrat-black")
GlobalFonts.registerFromPath("node_modules/greetify/build/structures/font/Montserrat-ExtraLight.ttf", "montserrat-extra-light")

const defaultAssets = {
background: "https://s6.imgcdn.dev/ZqH2S.png",
Expand Down
18 changes: 11 additions & 7 deletions example/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
(async () => {
const { welcomeCard } = require("../build/index");
// Importing modules
const { welcomeCard } = require("greetify");
const fs = require("fs")

const welcard = new welcomeCard()
// Card details here
const card = new welcomeCard()
.setName("FlameFace")
.setAvatar("https://images-ext-1.discordapp.net/external/nkz8HXtBh-7fSjsFGeAltG_THjuap1tmbd4pVcOsx9I/https/cdn.discordapp.com/avatars/786504767358238720/4d21f3a661f2f41eefe09e7aeb093fc0.webp")
.setMessage("YOU ARE 340th MEMBER")
.setAvatar("https://s6.imgcdn.dev/ZFQlq.png")
.setMessage("YOU ARE 688 MEMBER")
.setBackground("https://s6.imgcdn.dev/ZqH2S.png")
.setColor("00FF38") // without #
.setTitle("Welcome")

const output = await welcard.build();
// Building process
const output = await card.build();

fs.writeFileSync(`card.png`, output);
console.log("Done!");
// Save as image
fs.writeFileSync("card.png", output);
console.log("Done");
})()
25 changes: 17 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pixelord",
"description": "Pixelord is a powerful canvas project with high-quality assets & designs",
"name": "greetify",
"description": "Greetify is futuristic welcome card canvas library",
"version": "1.0.0",
"main": "build/index.js",
"types": "build/index.d.ts",
Expand All @@ -14,20 +14,29 @@
"welcome-card",
"welcome-canvas",
"canvas",
"pixelord",
"rank-card",
"discord-canvas"
"greetify",
"greeting",
"discord-canvas",
"discord.js"
],
"dependencies": {
"@napi-rs/canvas": "^0.1.44"
},
"license": "MIT",
"devDependencies": {
"@types/node": "^20.4.5",
"typescript": "^5.1.6"
},
"license": "GPL-3.0",
"author": "FlameFace",
"repository": {
"type": "git",
"url": "https://github.com/A3PIRE/pixelord.git"
"url": "https://github.com/A3PIRE/greetify.git"
},
"bugs": {
"url": "https://github.com/A3PIRE/pixelord/issues"
"url": "https://github.com/A3PIRE/greetify/issues"
},
"funding": {
"type": "githubsponser",
"url": "https://github.com/sponsors/flameface"
}
}

0 comments on commit e858425

Please sign in to comment.