-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerateInvite.js
48 lines (43 loc) · 1.27 KB
/
generateInvite.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
const systemglobal = require('./config.json');
const eris = require('eris');
const colors = require('colors');
const discordClient = new eris.CommandClient(systemglobal.DiscordToken, {
compress: true,
restMode: true,
}, {
name: "Gotcha",
description: "Message Monitoring System",
owner: "Yukimi Kazari",
restMode: true,
});
let init = 0;
let selfstatic = {};
discordClient.on("ready", () => {
console.log("Connected successfully to Discord!");
discordClient.getSelf()
.then(function(data) {
selfstatic = data
console.log(`Using Account: ${selfstatic.username} (${selfstatic.id})`)
})
.catch((er) => {
console.error("Error getting self identification, this is a major issue".bgRed)
console.error(er)
});
discordClient.createChannelInvite(process.argv[2], {
maxUses: 1,
maxAge: 120
})
.then((invite) => {
console.log(`ChannelInvite created here : "${invite.code}"`);
process.exit(0);
})
.catch((er) => {
console.error(er);
})
});
discordClient.on("error", (err) => {
console.error("Shard Error, Rebooting...")
console.error(err)
discordClient.connect()
});
discordClient.connect();