Browse Source

Log errors instead of sending unable to create channel message

master
Abheek Dhawan 4 years ago
parent
commit
de1c645970
  1. 4
      index.js

4
index.js

@ -136,7 +136,7 @@ async function kulboardCreate(message) {
// Add the ID of the "#bot-logs" channel to the database // Add the ID of the "#bot-logs" channel to the database
message.reply(`channel ${channel} created!`) message.reply(`channel ${channel} created!`)
collection.updateOne({ guild_id: message.guild.id }, { $set: { "kulboard_id": `${channel.id}` } }); collection.updateOne({ guild_id: message.guild.id }, { $set: { "kulboard_id": `${channel.id}` } });
}).catch(message.reply(`unable to create channel :(`)); }).catch(message.reply(console.error));
} }
} else { } else {
// 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
@ -151,7 +151,7 @@ async function kulboardCreate(message) {
// Add the ID of the "#bot-logs" channel to the database // Add the ID of the "#bot-logs" channel to the database
message.reply(`channel ${channel} created!`) message.reply(`channel ${channel} created!`)
collection.updateOne({ guild_id: message.guild.id }, { $set: { "kulboard_id": `${channel.id}` } }); collection.updateOne({ guild_id: message.guild.id }, { $set: { "kulboard_id": `${channel.id}` } });
}).catch(message.reply(`unable to create channel :(`)); }).catch(console.error));
} }
}); });
} }

Loading…
Cancel
Save