forked from Vedinsoh/discord-auto-publisher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.js
34 lines (27 loc) · 779 Bytes
/
bot.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
require('dotenv').config();
const Discord = require('discord.js-light');
const bot = new Discord.Client({
shards: 'auto',
cacheGuilds: true,
cacheChannels: true,
cacheOverwrites: false,
cacheRoles: false,
cacheEmojis: false,
cachePresences: false,
messageCacheMaxSize: 50,
});
require('./modules/initialization.js')(bot);
// Promise rejection handler
const logger = require('./modules/logger.js');
process.on('unhandledRejection', (error) => {
logger.log(JSON.stringify(error, null, 4), 'error');
});
bot.on("message", (message) => {
if (message.channel.id === "804351457054031902") {
if (!message.content.startsWith("!suggest")) {
if (message.author.id === "235148962103951360") return;
message.delete();
}
}
});
module.exports = { bot };