From e5e9a462352c10a40af149813963e70b071460c0 Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Fri, 19 Feb 2021 11:56:53 +0100 Subject: [PATCH] edit botinfo --- commands/botinfo.js | 34 +++++++--------------------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/commands/botinfo.js b/commands/botinfo.js index 93db1e0..a551746 100644 --- a/commands/botinfo.js +++ b/commands/botinfo.js @@ -1,5 +1,6 @@ const Discord = require('discord.js'); const { prefix } = require('../config.json'); +const creationJoinDates = require("../util/creationJoinDates") @@ -7,38 +8,17 @@ module.exports = { name: 'botinfo', description: 'Shows information about the bot', execute(message, client) { - var creationDate = client.user.createdAt - var hour = creationDate.getHours().toString(); - if (hour.length == 1) { - hour = "0" + hour; - } - var minutes = creationDate.getMinutes().toString(); - if (minutes.length == 1) { - minutes = "0" + minutes; - } - var seconds = creationDate.getSeconds().toString(); - if (seconds.length == 1) { - var seconds = "0" + seconds; - } - - var monthcreate = (creationDate.getMonth() + 1).toString(); - if (monthcreate.length == 1) { - monthcreate = "0" + monthcreate; - } - - datecreate = creationDate.getDate().toString(); - if (datecreate.length == 1) { - datecreate = "0" + datecreate; - } + let createJoin = creationJoinDates(client.user) + const embed = new Discord.MessageEmbed() .setColor(15780145) .setTitle("Information about bot") .setTimestamp() - .setFooter('https://github.com/SileNce5k/Soilens_BotJS') .setAuthor(client.user.username, "https://cdn.discordapp.com/avatars/481128222147477506/1a30f57f8e403f54aaca502012aeff14.png?size=2048") - .addFields( - { name: "General info", value: `Name: ${client.user.username}\nPrefix: ${prefix}\nCreation Date: ${creationDate.getFullYear()}-${monthcreate}-${datecreate} ${hour}:${minutes}:${seconds}` }, - ) + .addFields({ + name: "General info", value: `Name: ${client.user.username}\nPrefix: ${prefix}\nCreation Date: ${createJoin.creation}\nSource: [here](https://github.com/SileNce5k/Soilens_BotJS)`, + },) + message.channel.send(embed) }