Skip to content

Commit

Permalink
Add number of connected players to players command (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
src4026 authored Nov 4, 2023
1 parent 758e9b6 commit c088ba4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions botcmds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
})

0 comments on commit c088ba4

Please sign in to comment.