nyx/bot.js

51 lines
1.6 KiB
JavaScript
Raw Normal View History

2021-09-21 01:51:56 +02:00
const { MessageEmbed, Intents } = require("discord.js");
const Cath = require("./client/Cath");
const version = require("./package.json").version;
2021-09-21 01:51:56 +02:00
const config = require("./config.json");
const client = new Cath({
2021-07-13 05:17:39 +02:00
allowedMentions: { parse: ["users", "roles"], repliedUser: true },
presence: {
activities: [
{
name: `v${version} | ${config.prefix}help`,
type: "STREAMING",
url: "https://www.youtube.com/watch?v=_D5xG7XoF88",
},
],
},
2021-07-13 05:17:39 +02:00
restTimeOffset: 0,
partials: ["MESSAGE", "CHANNEL", "REACTION", "GUILD_MEMBER"],
2021-09-06 12:38:25 +02:00
intents: [
//Intents.FLAGS.GUILD_MEMBERS,
2021-09-21 01:51:56 +02:00
//Intents.FLAGS.GUILD_PRESENCES,
Intents.FLAGS.GUILDS,
2021-09-06 12:38:25 +02:00
Intents.FLAGS.GUILD_BANS,
Intents.FLAGS.GUILD_EMOJIS_AND_STICKERS,
Intents.FLAGS.GUILD_INVITES,
Intents.FLAGS.GUILD_VOICE_STATES,
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
Intents.FLAGS.DIRECT_MESSAGES,
2021-09-21 01:51:56 +02:00
Intents.FLAGS.DIRECT_MESSAGE_TYPING,
2021-09-06 12:38:25 +02:00
],
2021-07-13 05:17:39 +02:00
});
module.exports = client;
require("./util/functions/economy")(client);
require("./util/dist/manager")(client);
2021-09-06 12:38:25 +02:00
require("./util/dist/handler")(client);
process.on("unhandledRejection", async err => {
if (client.user) {
if (client.user.id === client.user.id) {
const embed = new MessageEmbed()
.setTitle("UnhandledRejection Error")
.setDescription(`\`\`\`ini\n${err.stack}\`\`\``)
.setTimestamp()
.setColor(client.color)
.setFooter(client.user.username);
client.channels.cache.get(client.ErrorLog).send({ embeds: [embed] });
}
}
2021-09-21 01:51:56 +02:00
return console.error(err);
2021-07-13 05:17:39 +02:00
});
2021-09-21 01:51:56 +02:00
client.start();