-
Notifications
You must be signed in to change notification settings - Fork 272
/
index.js
54 lines (43 loc) · 1.69 KB
/
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
50
51
52
53
54
const
CLIENT_ID = "Add your client id here",
express = require("express"),
chalk = require("chalk"),
server = express(),
prompt = require("prompt-sync")({ sigint: true }),
dotenv = require('dotenv'),
{ Client } = require('discord.js-selfbot-v11'),
client = new Client(),
statuses = new Map([
[1, ["playing", chalk.yellowBright.bold]],
[2, ["listening", chalk.greenBright.bold]],
[3, ["streaming", chalk.magentaBright.bold]]
]);
dotenv.config();
if (!process.env.TOKEN) {
console.error("You need to add a token inside Secrets.");
process.exit();
}
console.log(`${chalk.cyanBright.bold("Statuscord")} | ${chalk.greenBright.bold("SealedSaucer")}`);
server.all("/", (req, res) => res.send(`<meta http-equiv="refresh" content="0; URL=https://phantom.fr.to/support"/>`));
server.listen(process.env.PORT ?? 3000);
client.login(process.env.TOKEN);
console.log(`\n[${chalk.green.bold("+")}] The webserver is ready.\n`);
console.log(
`[${chalk.yellow.bold("!")}] Which presence would you like to start?\n`,
[ ...statuses.entries() ]
.map(([number, [statusName]]) => "\n" + `[${number}] ${statusName.replace(/^./, m => m.toUpperCase())}`)
.join("") + "\n"
);
const number = prompt("> ");
const [statusName, style] = statuses.get(+number);
if (statusName) {
const statusModule = require(`./statuses/${statusName}.js`);
console.clear();
client.on("ready", _ => statusModule(client, CLIENT_ID)
.then(_ => console.log(`[${style(statusName.toUpperCase())}] Successfully logged in as ${client.user.username}#${client.user.discriminator} (${client.user.id})!`))
.catch(console.error)
);
} else {
console.log(`[${chalk.red.bold("-")}] Invalid option.`);
process.exit();
}