|
1 |
| -# **About** |
2 |
| -**Greetify** is futuristic welcome card canvas library |
| 1 | +<img src="https://ik.imagekit.io/unburn/greetify.svg"/> |
3 | 2 |
|
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 | +[](https://www.npmjs.com/package/greetify) |
| 13 | +[](https://www.npmjs.com/package/greetify) |
| 14 | +[](https://github.com/unburn/greetify/blob/main/LICENCE) |
| 15 | +[](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 |
5 | 24 | ```
|
6 |
| -npm i greetify |
| 25 | +npm install greetify |
7 | 26 | ```
|
8 | 27 |
|
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 | +}) |
33 | 47 | ```
|
34 | 48 |
|
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({ |
60 | 69 | files: [{
|
61 |
| - attachment: output, |
62 |
| - name: `${member.id}.png` |
| 70 | + attachment: card |
63 | 71 | }]
|
64 | 72 | })
|
65 | 73 | })
|
66 | 74 | ```
|
67 | 75 |
|
68 |
| -### **Output** |
69 |
| - |
| 76 | +# Themes |
| 77 | +## Minimal |
| 78 | + |
| 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 | + |
| 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 | |
70 | 133 |
|
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) |
0 commit comments