-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.ts
42 lines (38 loc) · 989 Bytes
/
main.ts
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
import { Client, GatewayIntentBits, ActivityType } from 'discord.js'
import config from 'config.json'
import fs from 'fs'
import "dotenv";
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildPresences,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMessageReactions,
GatewayIntentBits.GuildMessageTyping,
GatewayIntentBits.MessageContent
],
presence: {
status: 'online',
activities: [
{
name: 'SR Discord',
type: ActivityType.Watching
}
]
}
})
client.on('ready', () => {
console.log(`Logged in as ${client.user?.tag ?? 'unknown'}!`)
})
fs.readdirSync('modules')
.map(mod => {
console.log('Loading module: ' + mod)
return `./modules/${mod}`
})
.map(async mod => await import(mod))
.forEach(async mod => {
const modResolved = await mod
await modResolved.default(client)
})
await client.login(config.token)