-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
34 lines (25 loc) · 884 Bytes
/
index.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
const Eris = require('eris')
const mongoose = require('mongoose')
const data = require('./data')
const modules = require('./modules')
const config = require('./config')
const handlers = require('./eventhandlers')
const create = async () => {
const mcn = await mongoose.connect(config.mongoUri)
const bot = new Eris(config.token, { maxShards: config.shards })
const send = (ch, content) => bot.createMessage(ch, content)
const sendEmbed = (ch, embed) => bot.createMessage(ch, { embed })
const makeEmbed = (content, type) => {
return Object.assign({}, data.embeds[type], {
description: content,
})
}
const ctx = {
bot, modules, mcn, data, config,
send, sendEmbed, makeEmbed,
}
handlers.init(ctx)
bot.connect()
require('./commands')
}
create()