This commit is contained in:
smsteel
2019-02-11 02:02:45 +03:00
parent 2ca64ec422
commit d3245d33ac
4 changed files with 18 additions and 76 deletions

14
bot.js
View File

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