2
0
mirror of https://github.com/thedevs-network/the-guard-bot synced 2025-08-31 14:15:25 +00:00

Minor improvements to /user

This commit is contained in:
GingerPlusPlus
2017-11-02 16:54:17 +01:00
parent 417bbb1dc9
commit 70b8f7bb0e

View File

@@ -7,7 +7,7 @@ const { link, scheduleDeletion } = require('../../utils/tg');
const { replyOptions } = require('../../bot/options');
// DB
const { getUser, getWarns } = require('../../stores/user');
const { getUser } = require('../../stores/user');
const getWarnsHandler = async ({ message, reply, state }) => {
const { isAdmin } = state;
@@ -29,12 +29,11 @@ const getWarnsHandler = async ({ message, reply, state }) => {
).then(scheduleDeletion);
}
let i = 0;
const warns = await getWarns(theUser);
const { warns } = theUser;
const warnsMessage = warns
? '⚠️ <b>Warns:</b>\n' +
warns
.map(warn => ++i + '. ' + warn)
.map((warn, i) => `${i + 1}. ${warn}`)
.join('\n')
: '✅ <b>no warns</b>';