-
Notifications
You must be signed in to change notification settings - Fork 32
/
index.js
50 lines (24 loc) · 947 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
const discord = require("discord.js");
const db = require('quick.db');
const { Client } = require('discord.js');
const { token } = require('./config.json');
const { CanvasSenpai } = require("canvas-senpai")
const canva = new CanvasSenpai();
client.commands = new discord.Collection();
client.aliases = new discord.Collection();
["command", "events"].forEach(handler => {
require(`./handler/${handler}`)(client);
});
client.on("guildMemberAdd", async member => {
let chx = db.get(`welchannel_${member.guild.id}`);
if (chx === null) {
return;
}
let data = await canva.welcome(member, { link: "https://i.pinimg.com/originals/f3/1c/39/f31c39d56512dc8fbf30f9d0fb3ee9d3.jpg" })
const attachment = new discord.MessageAttachment(
data,
"welcome-image.png"
);
client.channels.cache.get(chx).send("Welcome to our Server " + member.user.username, attachment);
});
client.login(token);