Added the 'import_ics' command

This commit is contained in:
ION606
2022-10-11 16:29:49 -04:00
parent d69e7e0479
commit 18894961bd
3 changed files with 323 additions and 47 deletions
+7 -2
View File
@@ -1,5 +1,5 @@
const fs = require('fs');
const {Buffer} = require('buffer');
const { Client } = require('discord.js');
function mapToObj(map){
const obj = {}
@@ -43,7 +43,10 @@ async function backupLists(bot, IDM) {
}
}
/**
* @param {Client} bot
* @param {Boolean} IDM
*/
async function loadBotBackups(bot, IDM) {
try {
if (IDM) {
@@ -52,6 +55,8 @@ async function loadBotBackups(bot, IDM) {
} else {
bot.lockedChannels = objToMap(JSON.parse(botBackups.locked));
}
// bot.user.setActivity("RESTARTING BOT, PLEASE STAND BY.mp3", { type: "LISTENING" }); // User is....undefined????
} catch (err) {
console.error(err);
bot.lockedChannels = new Map();