Skip to content

Commit 17a9a86

Browse files
committed
Commited from terminal.
1 parent daa43f5 commit 17a9a86

File tree

1 file changed

+52
-51
lines changed

1 file changed

+52
-51
lines changed

index.js

+52-51
Original file line numberDiff line numberDiff line change
@@ -9,85 +9,86 @@ const fetch = require("node-fetch");
99
const { request } = require("./helpers.js");
1010
let db = null;
1111
if (process.env.REPLIT_DB_URL) {
12-
// use replit database if it's hosted on replit
13-
const { Database } = require("quick.replit");
14-
db = new Database(process.env.REPLIT_DB_URL);
12+
// use replit database if it's hosted on replit
13+
const { Database } = require("quick.replit");
14+
db = new Database(process.env.REPLIT_DB_URL);
1515
} else {
16-
db = require("quick.db");
16+
db = require("quick.db");
1717
}
1818

19+
1920
const client = new GCommandsClient({
20-
cmdDir: join(__dirname, "commands"),
21-
eventDir: join(__dirname, "events"),
22-
language: "english",
23-
commands: {
24-
slash: "both",
25-
context: "false",
26-
prefix: config.prefix,
27-
},
28-
intents: [
29-
Intents.FLAGS.GUILDS,
30-
Intents.FLAGS.GUILD_MEMBERS,
31-
Intents.FLAGS.GUILD_INTEGRATIONS,
32-
Intents.FLAGS.GUILD_MESSAGES,
33-
Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
34-
Intents.FLAGS.GUILD_PRESENCES,
35-
],
36-
partials: ["CHANNEL", "MESSAGE", "GUILD_MEMBER"],
37-
autoTyping: config.autoTyping || false,
21+
cmdDir: join(__dirname, "commands"),
22+
eventDir: join(__dirname, "events"),
23+
language: "english",
24+
commands: {
25+
slash: "both",
26+
context: "false",
27+
prefix: config.prefix,
28+
},
29+
intents: [
30+
Intents.FLAGS.GUILDS,
31+
Intents.FLAGS.GUILD_MEMBERS,
32+
Intents.FLAGS.GUILD_INTEGRATIONS,
33+
Intents.FLAGS.GUILD_MESSAGES,
34+
Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
35+
Intents.FLAGS.GUILD_PRESENCES,
36+
],
37+
partials: ["CHANNEL", "MESSAGE", "GUILD_MEMBER"],
38+
autoTyping: config.autoTyping || false,
3839
});
3940
client.config = config;
4041
client.request = request;
4142
client.helpers = require("./helpers.js");
4243
client.db = db;
4344

4445
if (!config.token) {
45-
console.error("TOKEN is missing in .env file");
46-
process.exit();
46+
console.error("TOKEN is missing in .env file");
47+
process.exit();
4748
}
4849
if (!config.apiKey) {
49-
console.error("API_KEY is missing in .env file");
50-
process.exit();
50+
console.error("API_KEY is missing in .env file");
51+
process.exit();
5152
}
5253

5354
client.on("ready", async () => {
54-
console.log(`${client.user.tag} (AnonDev API Bot has started) has started!`);
55-
client.user.setPresence({
56-
activities: [
57-
{ name: "Powered by api.anondev.ml", type: "WATCHING" },
58-
{
59-
name: `Use ${config.prefix}help or type / to discover slash commands`,
60-
type: "PLAYING",
61-
},
62-
],
63-
status: "online",
64-
});
55+
console.log(`${client.user.tag} (AnonDev API Bot has started) has started!`);
56+
client.user.setPresence({
57+
activities: [
58+
{ name: "Powered by api.anondev.ml", type: "WATCHING" },
59+
{
60+
name: `Use ${config.prefix}help or type / to discover slash commands`,
61+
type: "PLAYING",
62+
},
63+
],
64+
status: "online",
65+
});
6566

66-
if (!config.owner) {
67-
// automatically fill owner in config
68-
await client.application.fetch();
69-
config.owner = client.application.owner
70-
? client.application.owner.id
71-
: null;
72-
}
67+
if (!config.owner) {
68+
// automatically fill owner in config
69+
await client.application.fetch();
70+
config.owner = client.application.owner
71+
? client.application.owner.id
72+
: null;
73+
}
7374
});
7475

7576
client.on("log", console.log);
7677
client.on("error", console.error);
7778

7879
if (config.debug) {
79-
client.on("debug", console.log);
80-
client.on("rateLimit", console.log);
81-
client.on("warn", console.warn);
80+
client.on("debug", console.log);
81+
client.on("rateLimit", console.log);
82+
client.on("warn", console.warn);
8283
}
8384

8485
client.login(config.token);
8586

8687
process.on("uncaughtException", (err) => {
87-
console.error("There was an uncaught error", err);
88-
if (config.exitOnCrash) {
89-
process.exit(1);
90-
}
88+
console.error("There was an uncaught error", err);
89+
if (config.exitOnCrash) {
90+
process.exit(1);
91+
}
9192
});
9293

9394
require("./auto-meme.js")(client);

0 commit comments

Comments
 (0)