-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
74 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | ||
})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters