Skip to content

Commit

Permalink
fix(irc): status message fails when enough IRC puppets are connected (#…
Browse files Browse the repository at this point in the history
…84)

A message cannot exceed 2000 characters, which was easily reached.
So instead, give a more summarized result.
  • Loading branch information
TrueBrain committed Oct 19, 2022
1 parent 842d702 commit b7e6fd1
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions dibridge/irc.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,9 @@ def get_status(self):
else:
status = ":red_circle: **IRC** not connected\n"
if self._puppets:
joined = len([True for puppet in self._puppets.values() if puppet._joined])
status += "\n"
status += "IRC connections:\n"
for discord_id, puppet in self._puppets.items():
if puppet._joined:
status += f"- :green_circle: <@{discord_id}> connected as `{puppet._nickname}`\n"
else:
status += f"- :orange_circle: <@{discord_id}> connecting as `{puppet._nickname}`\n"
status += f"**{len(self._puppets)}** IRC connections, **{joined}** connected\n"
return status

def get_irc_username(self, discord_id, discord_username):
Expand Down

0 comments on commit b7e6fd1

Please sign in to comment.