-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.js
29 lines (26 loc) · 1.04 KB
/
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
const {Client, GatewayIntentBits, REST, Routes, ActivityType} = require("discord.js");
const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMembers, GatewayIntentBits.GuildVoiceStates] });
const {config, commands} = require("./config")
const {setupCommands} = require("./cmd/list")
const rest = new REST({ version: '10' }).setToken(config.TOKEN);
try {
console.log('🔄 [Action] Refreshing (/) commands.');
(async () => {
await rest.put(Routes.applicationCommands(config.CLIENTID), { body: commands });
})();
console.log('✅ [Action] Commands (/) refresh complete.');
} catch (err) {
console.error(err);
}
client.on("ready", () => {
console.log(`😎 [BOT] Loaded as ${client.user.tag}!`);
setInterval(() => {
client.user.setActivity(config.StatusList[Math.floor(Math.random() * config.StatusList.length)], {
type: ActivityType.Watching
});
}, 15000);
const timestamp = Date.now();
client.rundate = timestamp
setupCommands(client)
});
client.login(config.TOKEN);