Add amount of connected players to `players` command

This commit is contained in:
s20 2023-10-25 01:46:10 +05:30 committed by GitHub
parent 758e9b6361
commit ae917df471
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
})