Skip to content

Commit 70b8f7b

Browse files
committed
Minor improvements to /user
1 parent 417bbb1 commit 70b8f7b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

handlers/commands/user.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const { link, scheduleDeletion } = require('../../utils/tg');
77
const { replyOptions } = require('../../bot/options');
88

99
// DB
10-
const { getUser, getWarns } = require('../../stores/user');
10+
const { getUser } = require('../../stores/user');
1111

1212
const getWarnsHandler = async ({ message, reply, state }) => {
1313
const { isAdmin } = state;
@@ -29,12 +29,11 @@ const getWarnsHandler = async ({ message, reply, state }) => {
2929
).then(scheduleDeletion);
3030
}
3131

32-
let i = 0;
33-
const warns = await getWarns(theUser);
32+
const { warns } = theUser;
3433
const warnsMessage = warns
3534
? '⚠️ <b>Warns:</b>\n' +
3635
warns
37-
.map(warn => ++i + '. ' + warn)
36+
.map((warn, i) => `${i + 1}. ${warn}`)
3837
.join('\n')
3938
: '✅ <b>no warns</b>';
4039

0 commit comments

Comments
 (0)