-
Notifications
You must be signed in to change notification settings - Fork 0
/
shoredark.ts
59 lines (53 loc) · 1.72 KB
/
shoredark.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import 'reflect-metadata'
import { format } from 'date-fns'
import { Intents } from 'discord.js'
import { Client } from 'discordx'
import * as dotenv from 'dotenv'
import { Logger } from './plugins/tools'
import { importx } from '@discordx/importer'
dotenv.config({ path: __dirname + '/.env' })
async function start() {
const client = new Client({
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.GUILD_VOICE_STATES,
Intents.FLAGS.GUILD_EMOJIS_AND_STICKERS,
Intents.FLAGS.DIRECT_MESSAGE_REACTIONS,
Intents.FLAGS.DIRECT_MESSAGES,
Intents.FLAGS.DIRECT_MESSAGE_TYPING,
Intents.FLAGS.GUILD_INTEGRATIONS,
Intents.FLAGS.GUILD_PRESENCES,
Intents.FLAGS.GUILD_WEBHOOKS,
Intents.FLAGS.GUILD_MEMBERS,
Intents.FLAGS.GUILD_INVITES,
Intents.FLAGS.GUILD_BANS,
],
botGuilds: [process.env.GUILD_ID!],
})
try {
client.on('ready', async () => {
console.clear()
Logger.writeLog(`\r\n${'-'.repeat(10)} Shoredark ${'-'.repeat(10)}`, true)
Logger.writeLog(
`Booted at ${format(new Date(), 'yyyy-MM-dd HH:mm:ss:SSS')}\r\n`,
true
)
Logger.log('Initializing current slash commands...')
// await client.clearApplicationCommands(process.env.GUILD_ID)
await client.initApplicationCommands()
await client.initApplicationPermissions()
Logger.log('...DONE')
Logger.log('Shoredark is Ready')
})
client.on('interactionCreate', (interaction) => {
client.executeInteraction(interaction)
})
await importx(`${__dirname}/commands/**/*.{ts,js}`)
client.login(process.env.CLIENT_TOKEN)
} catch (e) {
Logger.log('Exception', true)
console.error(e)
}
}
start()