From 77392c2364c04ef585307a2356fed905f3067b09 Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Sat, 3 Apr 2021 11:18:30 -0500 Subject: [PATCH] Use message.guild instead of guild --- index.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 4037bce..ed683b3 100644 --- a/index.js +++ b/index.js @@ -84,7 +84,7 @@ async function startLogs(message) { if (error) { console.error; } - if (result.botLogsChannel) { + if (result.bot_logs_id) { botLogsChannel = result.bot_logs_id; if (message.guild.channels.cache.get(botLogsChannel)) { message.reply('bot logs channel already exists!'); @@ -92,15 +92,14 @@ async function startLogs(message) { // Create "#bot-logs" text channel to track message deletes, edits, and channel creations message.guild.channels.create('bot-logs', { type: 'text', - parent: channel.id, // Remove view permissions from "@everyone" permissionOverwrites: [{ - id: guild.id, + id: message.guild.id, deny: ['VIEW_CHANNEL'], }] }).then(channel => { // Add the ID of the "#bot-logs" channel to the database - collection.updateOne({ guild_id: guild.id }, { $set: { "bot_logs_id": `${channel.id}` } }); + collection.updateOne({ guild_id: message.guild.id }, { $set: { "bot_logs_id": `${channel.id}` } }); }); } }