table test

This commit is contained in:
smsteel 2019-02-11 09:20:05 +03:00
parent 9ed230430a
commit 5f67298b37
2 changed files with 2 additions and 3 deletions

4
bot.js
View File

@ -9,7 +9,7 @@ import {
} from './types' } from './types'
import { currentTime } from './utility' import { currentTime } from './utility'
import { getEntityDeathMessage, getEntityName } from './ru' import { getEntityDeathMessage, getEntityName } from './ru'
import table from 'string-table' import stringTable from 'string-table'
const bot = new Telegraf('643297173:AAGuqfZx3GhiiARwvY7AtWTTFw1T-2FiwCM') const bot = new Telegraf('643297173:AAGuqfZx3GhiiARwvY7AtWTTFw1T-2FiwCM')
const markdown = TelegrafExtra.markdown() const markdown = TelegrafExtra.markdown()
@ -19,7 +19,7 @@ bot.command(
'players', 'players',
({ replyWithMarkdown }) => getPlayersData() ({ replyWithMarkdown }) => getPlayersData()
.then(getPlayersData => replyWithMarkdown( .then(getPlayersData => replyWithMarkdown(
table( stringTable.create(
getPlayersData getPlayersData
.map(({ displayName, level, online }) => ({ .map(({ displayName, level, online }) => ({
'имя ': `👤 *${displayName}*`, 'имя ': `👤 *${displayName}*`,

View File

@ -24,7 +24,6 @@
"express": "^4.16.4", "express": "^4.16.4",
"sqlite3": "^4.0.6", "sqlite3": "^4.0.6",
"string-table": "^0.1.5", "string-table": "^0.1.5",
"table": "^5.2.3",
"telegraf": "^3.27.1" "telegraf": "^3.27.1"
} }
} }