Skip to content

Commit 42079f9

Browse files
Release 2.0
1 parent b2a435c commit 42079f9

28 files changed

+398
-280
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules
2-
package-lock.json
2+
dist
3+
package-lock.json

.npmignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/node_modules
2+
/src
3+
/tests
4+
5+
tsconfig.json
6+
tsup.config.ts

README.md

Lines changed: 122 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,135 @@
1-
# **About**
2-
**Greetify** is futuristic welcome card canvas library
1+
<img src="https://ik.imagekit.io/unburn/greetify.svg"/>
32

4-
# **Installation**
3+
<p align="center">Futuristic welcome card canvas library</p>
4+
5+
<p align="center">
6+
<a href="https://github.com/unburn/greetify"><b>Github</b></a> •
7+
<a href="https://discord.gg/66uGX7t4ww"><b>Support</b></a>
8+
</p>
9+
10+
<div align="center">
11+
12+
[![NPM Version](https://img.shields.io/npm/v/greetify?style=flat-square&color=%2300D684)](https://www.npmjs.com/package/greetify)
13+
[![NPM Downloads](https://img.shields.io/npm/dw/greetify?style=flat-square&color=%2300D684)](https://www.npmjs.com/package/greetify)
14+
[![NPM License](https://img.shields.io/npm/l/greetify?style=flat-square&color=%2300D684)](https://github.com/unburn/greetify/blob/main/LICENCE)
15+
[![GitHub Repo stars](https://img.shields.io/github/stars/unburn/greetify?style=flat-square&color=%2300D684)](https://github.com/unburn/greetify)
16+
17+
</div>
18+
19+
<div align="center">
20+
<a href="https://github.com/sponsors/flameface"><img src="https://ik.imagekit.io/unburn/support-greetify.svg?updatedAt=1710761418683"/></a>
21+
</div>
22+
23+
# Installation
524
```
6-
npm i greetify
25+
npm install greetify
726
```
827

9-
# **Example Usage**
10-
This example code will create a welcome card and save it as a png.
11-
```js
12-
(async () => {
13-
// Importing modules
14-
const { welcomeCard } = require("greetify");
15-
const fs = require("fs")
16-
17-
// Card details here
18-
const card = new welcomeCard()
19-
.setName("FlameFace")
20-
.setAvatar("https://s6.imgcdn.dev/ZFQlq.png")
21-
.setMessage("YOU ARE 688 MEMBER")
22-
.setBackground("https://s6.imgcdn.dev/ZqH2S.png")
23-
.setColor("00FF38") // without #
24-
.setTitle("Welcome")
25-
26-
// Building process
27-
const output = await card.build();
28-
29-
// Save as image
30-
fs.writeFileSync("card.png", output);
31-
console.log("Done");
32-
})()
28+
# Usage
29+
30+
## Using File System (FS)
31+
```javascript
32+
import { Panorama } from "greetify";
33+
import fs from "fs";
34+
35+
// OR
36+
37+
const { Panorama } = require("greetify");
38+
const fs = require('fs')
39+
40+
Panorama({
41+
avatar: "https://cdn.discordapp.com/avatars/786504767358238720/f65e8322c0c290e7fc1d9ad20322256b.webp",
42+
name: "FLAMEFACE",
43+
type: "WELCOME",
44+
}).then(x => {
45+
fs.writeFileSync("greetify.png", x)
46+
})
3347
```
3448

35-
This example is of **Discord Bot** using discord.js
36-
```js
37-
// Importing modules
38-
const { welcomeCard } = require("greetify");
39-
const { AttachmentBuilder } = require("discord.js")
40-
41-
// Make sure to define client
42-
client.on('guildMemberAdd', async (member) => {
43-
// Card details here
44-
const card = new welcomeCard()
45-
.setName("FlameFace")
46-
.setAvatar("https://s6.imgcdn.dev/ZFQlq.png")
47-
.setMessage("YOU ARE 688 MEMBER")
48-
.setBackground("https://s6.imgcdn.dev/ZqH2S.png")
49-
.setColor("00FF38") // without #
50-
.setTitle("Welcome")
51-
52-
// Building process
53-
const output = await card.build()
54-
55-
// Fetch channel from members guild using ID
56-
const channel = member.guild.channels.cache.get("0000000000000000000");
57-
58-
// Sends card to the "channel"
59-
await channel.send({
49+
## In Discord Bot
50+
```javascript
51+
// Assuming you defined client
52+
const { Minimal } = require("greetify");
53+
54+
client.on("guildMemberAdd", async member => {
55+
const message = `YOU ARE ${member.guild.memberCount}TH MEMBER`
56+
57+
const card = await Minimal({
58+
name: member.user.username,
59+
avatar: member.user.displayAvatarURL({
60+
size: 4096 // For High Res Avatar
61+
}),
62+
type: "WELCOME",
63+
message: message
64+
})
65+
66+
const channel = member.guild.channels.cache.get("1201155869610627212");
67+
68+
return channel.send({
6069
files: [{
61-
attachment: output,
62-
name: `${member.id}.png`
70+
attachment: card
6371
}]
6472
})
6573
})
6674
```
6775

68-
### **Output**
69-
![welcome-preview](https://s6.imgcdn.dev/ZFifB.png)
76+
# Themes
77+
## Minimal
78+
![minimal](https://ik.imagekit.io/unburn/minimal.svg)
79+
80+
```javascript
81+
const { Minimal } = require("greetify");
82+
const fs = require('fs')
83+
84+
Minimal({
85+
avatar: "https://cdn.discordapp.com/avatars/786504767358238720/f65e8322c0c290e7fc1d9ad20322256b.webp",
86+
name: "FLAMEFACE",
87+
type: "WELCOME"
88+
}).then(x => {
89+
fs.writeFileSync("greetify.png", x)
90+
})
91+
```
92+
93+
### Minimal Options
94+
| Parameters | Types | Default |
95+
| --------------- | ------- | -------------------------------------------------- |
96+
| avatar* | string | none |
97+
| backgroundImage | string | https://ik.imagekit.io/unburn/greetify-default.png |
98+
| circleBorder | boolean | false |
99+
| message* | string | none |
100+
| messageColor | string | #FFFFFF |
101+
| name* | string | none |
102+
| nameColor | string | #00FF9E |
103+
| type | string | WELCOME |
104+
| typeColor | string | #FFFFFF |
105+
106+
107+
## Panorama
108+
![panorama](https://ik.imagekit.io/unburn/panorama.svg)
109+
110+
```javascript
111+
const { Panorama } = require("greetify");
112+
const fs = require('fs')
113+
114+
Panorama({
115+
avatar: "https://cdn.discordapp.com/avatars/786504767358238720/f65e8322c0c290e7fc1d9ad20322256b.webp",
116+
name: "FLAMEFACE",
117+
type: "WELCOME"
118+
}).then(x => {
119+
fs.writeFileSync("greetify.png", x)
120+
})
121+
```
122+
123+
### Panorama Options
124+
| Parameters | Types | Default |
125+
| --------------- | ------- | -------------------------------------------------- |
126+
| avatar* | string | none |
127+
| backgroundImage | string | https://ik.imagekit.io/unburn/greetify-default.png |
128+
| circleBorder | boolean | false |
129+
| name* | string | none |
130+
| nameColor | string | #00FF9E |
131+
| type | string | WELCOME |
132+
| typeColor | string | #FFFFFF |
70133

71-
# **Help**
72-
If you need help or want some features to be added, join our official **[burnxpofficial](https://discord.gg/qDysF95NWh)** community.
134+
# Licence
135+
[GPL](https://github.com/unburn/greetify/blob/main/LICENCE)

build/index.d.ts

Lines changed: 0 additions & 19 deletions
This file was deleted.

build/index.js

Lines changed: 0 additions & 3 deletions
This file was deleted.
-194 KB
Binary file not shown.
-193 KB
Binary file not shown.

build/structures/welcomeCard.js

Lines changed: 0 additions & 159 deletions
This file was deleted.

example/card.png

-896 KB
Binary file not shown.

0 commit comments

Comments
 (0)