From 1e182561f9ca802bc852e061e469368f0a624bb4 Mon Sep 17 00:00:00 2001 From: PetyXbronCZ Date: Fri, 16 Jul 2021 16:41:48 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=98=8D=20[1.1.3]=20-=20Working=20voting?= =?UTF-8?q?=20channel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fixed voting channel - Added version of project command (only dm) --- events/message.js | 14 +++++++++++++- package.json | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/events/message.js b/events/message.js index 489740d..f943fd5 100644 --- a/events/message.js +++ b/events/message.js @@ -1,7 +1,19 @@ const ms = require('ms') +const version = require('../package.json').version module.exports = async (bot, message) => { if(message.author.bot) return; + if(message.channel.type === "dm") { + if(message.content.includes('minecraft-bot version')) { + message.channel.startTyping(); + setTimeout(function(){ + message.channel.stopTyping(); + message.channel.send(version); + }, ms('1,5s')); + return; + } + return; + } const { prefix, server, config } = bot; @@ -9,7 +21,7 @@ module.exports = async (bot, message) => { const cmd = messageArray[0]; const args = messageArray.slice(1); - if(config.settings.votingCH) { + if(config.settings.votingCH && message.channel.id === config.votingCH.channel.id) { if(message.content.startsWith(prefix)) return; message.react(config.votingCH.reactions.first) diff --git a/package.json b/package.json index 0e8f68f..c28e466 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "minecraft-bot", - "version": "1.1.2", + "version": "1.1.3", "description": "Discord minecraft bot, with which you can check your minecraft server status (online players, version, online status etc.)", "main": "index.js", "scripts": {