table?
This commit is contained in:
14
bot.js
14
bot.js
@ -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()
|
||||
|
||||
Reference in New Issue
Block a user