Skip to content
This repository has been archived by the owner on Sep 22, 2022. It is now read-only.

Commit

Permalink
Fix undefined samplePlayers
Browse files Browse the repository at this point in the history
  • Loading branch information
Virenbar committed Sep 12, 2021
1 parent ea3018b commit 7a195e3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "minecraftingdbot",
"version": "3.1.0",
"version": "3.1.1",
"description": "Discord bot for unofficial Minecrafting.ru discord",
"main": "index.js",
"scripts": {
Expand Down
6 changes: 1 addition & 5 deletions src/modules/playercountA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ async function CountLoop(): Promise<void> {
const data = await status(server.host, { port: server.port })
online = data.onlinePlayers
max = data.maxPlayers
players = data.samplePlayers.map((p) => { return p.name })
/* if (online != lastOnline) {
await BotClient.user.setActivity("на " + online + " из " + max + " игроков", { "type": "WATCHING" })
lastOnline = online
} */
players = data.samplePlayers ? data.samplePlayers.map((p) => { return p.name }) : []
await sleep(10 * 1000)
} catch (err) {
Bot.logger.error('Player Count - Error')
Expand Down

0 comments on commit 7a195e3

Please sign in to comment.