29 lines
604 B
JavaScript
29 lines
604 B
JavaScript
|
const Eris = require("eris");
|
||
|
const { discordToken, watchedGuildIds } = require("./config");
|
||
|
const WatchedGuild = require("./WatchedGuild");
|
||
|
|
||
|
const bot = new Eris(discordToken, {
|
||
|
intents: [
|
||
|
"guildMessages"
|
||
|
]
|
||
|
});
|
||
|
|
||
|
const guildMap = new Map();
|
||
|
|
||
|
bot.on("ready", () => {
|
||
|
console.log("discord bot: ready");
|
||
|
watchedGuildIds.forEach(id => {
|
||
|
const watchedGuild = new WatchedGuild();
|
||
|
watchedGuild.upstreamGuildId = id;
|
||
|
watchedGuild.discordConnect(bot);
|
||
|
guildMap.set(id, watchedGuild);
|
||
|
});
|
||
|
});
|
||
|
|
||
|
bot.connect();
|
||
|
|
||
|
module.exports = {
|
||
|
bot,
|
||
|
guildMap
|
||
|
};
|