Add number of connected players to `players` command (#73)

This commit is contained in:
s20 2023-11-04 23:26:07 +05:30 committed by GitHub
parent 758e9b6361
commit c088ba4e40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -169,8 +169,10 @@ irc.register_bot_command("players", {
for _, player in pairs(players) do
table.insert(names, player:get_player_name())
end
return true, "Connected players: "
..table.concat(names, ", ")
return true, string.format("%d connected player(s): %s",
#players,
table.concat(names, ", ")
)
end
})