Browse Source

Use message.guild instead of guild

master
Abheek Dhawan 4 years ago
parent
commit
77392c2364
  1. 7
      index.js

7
index.js

@ -84,7 +84,7 @@ async function startLogs(message) {
if (error) { if (error) {
console.error; console.error;
} }
if (result.botLogsChannel) { if (result.bot_logs_id) {
botLogsChannel = result.bot_logs_id; botLogsChannel = result.bot_logs_id;
if (message.guild.channels.cache.get(botLogsChannel)) { if (message.guild.channels.cache.get(botLogsChannel)) {
message.reply('bot logs channel already exists!'); 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 // Create "#bot-logs" text channel to track message deletes, edits, and channel creations
message.guild.channels.create('bot-logs', { message.guild.channels.create('bot-logs', {
type: 'text', type: 'text',
parent: channel.id,
// Remove view permissions from "@everyone" // Remove view permissions from "@everyone"
permissionOverwrites: [{ permissionOverwrites: [{
id: guild.id, id: message.guild.id,
deny: ['VIEW_CHANNEL'], deny: ['VIEW_CHANNEL'],
}] }]
}).then(channel => { }).then(channel => {
// Add the ID of the "#bot-logs" channel to the database // 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}` } });
}); });
} }
} }

Loading…
Cancel
Save