This commit is contained in:
smsteel
2019-02-11 01:53:45 +03:00
parent 75a0b40af5
commit 6aed4a96d7
3 changed files with 16 additions and 3 deletions

10
bot.js
View File

@ -9,6 +9,7 @@ import {
} from './types'
import { currentTime } from './utility'
import { getEntityDeathMessage, getEntityName } from './ru'
import stringTable from 'string-table'
const bot = new Telegraf('643297173:AAGuqfZx3GhiiARwvY7AtWTTFw1T-2FiwCM')
const markdown = TelegrafExtra.markdown()
@ -18,9 +19,12 @@ bot.command(
'players',
({ replyWithMarkdown }) => getPlayersData()
.then(getPlayersData => replyWithMarkdown(
getPlayersData
.map(({ displayName, level, online }) => `👤 *${displayName}* уровень ${level} ${online ? '✅ *онлайн*' : '❔ оффлайн'}`)
.join('\n')
stringTable.create(getPlayersData
.map(({ displayName, level, online }) => ({
'имя': `👤 *${displayName}*`,
'уровень': level,
'статус': `${online ? '✅ *онлайн*' : '❔ оффлайн'}`
})))
))
)
bot.launch()