From c6d10ac10b43286b83dfeb9b8f3572466eeb53fd Mon Sep 17 00:00:00 2001 From: loicbersier Date: Wed, 3 Jun 2020 00:45:13 +0200 Subject: [PATCH] Show if current server have logging setup Signed-off-by: loicbersier --- commands/utility/server.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/commands/utility/server.js b/commands/utility/server.js index 010701b4..c57f109f 100644 --- a/commands/utility/server.js +++ b/commands/utility/server.js @@ -1,4 +1,5 @@ const { Command } = require('discord-akairo'); +const LogStats = require('../../models/').LogStats; class ServerCommand extends Command { constructor() { @@ -24,16 +25,19 @@ class ServerCommand extends Command { .addField('Number of users', message.guild.memberCount - botCount, true) .addField('Number of bots', botCount, true) .addField('Total number of members', message.guild.memberCount, true) - .addField('Number of channels', message.guild.channels.cache.size, true) + .addField('Number of channels', message.guild.channels.cache.size, true) .addField('​', '​') .addField('Date when guild created', message.guild.createdAt, true) .addField('Owner', message.guild.owner, true) .setTimestamp(); - - + const logStats = await LogStats.findOne({where: {guild: message.guild.id}}); + + if (logStats) addEmbed.addField('Logging', 'On ✅'); + else addEmbed.addField('Logging', 'Off ❌'); + message.channel.send({ embed: addEmbed }); } } -module.exports = ServerCommand; \ No newline at end of file +module.exports = ServerCommand;