Count self as bot
This commit is contained in:
parent
13e7fe378e
commit
c0b6c498b7
1 changed files with 5 additions and 4 deletions
|
|
@ -34,7 +34,7 @@ class InfoBot(yaboli.Bot):
|
||||||
|
|
||||||
nick = "\001({}P {}B {}L)".format(
|
nick = "\001({}P {}B {}L)".format(
|
||||||
len(self.room.get_people()),
|
len(self.room.get_people()),
|
||||||
len(self.room.get_bots()),
|
len(self.room.get_bots()) + 1, # we are a bot
|
||||||
len(self.room.get_lurkers())
|
len(self.room.get_lurkers())
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -51,22 +51,23 @@ class InfoBot(yaboli.Bot):
|
||||||
msg = "Sorry, the --list and --name options can't be used simultaneously."
|
msg = "Sorry, the --list and --name options can't be used simultaneously."
|
||||||
|
|
||||||
elif ("name" in options and options["name"] is not True) or "list" in options:
|
elif ("name" in options and options["name"] is not True) or "list" in options:
|
||||||
|
sessions = self.room.get_sessions() + [self.room.session]
|
||||||
clients = []
|
clients = []
|
||||||
|
|
||||||
if "name" in options:
|
if "name" in options:
|
||||||
name = self.room.mentionable(options["name"]).lower()
|
name = self.room.mentionable(options["name"]).lower()
|
||||||
|
|
||||||
clients = [c for c in self.room.get_sessions()
|
clients = [c for c in sessions
|
||||||
if self.room.mentionable(c.name).lower() == name]
|
if self.room.mentionable(c.name).lower() == name]
|
||||||
|
|
||||||
if name[:1] == "@":
|
if name[:1] == "@":
|
||||||
name = name[1:]
|
name = name[1:]
|
||||||
clients.extend([c for c in self.room.get_sessions()
|
clients.extend([c for c in sessions
|
||||||
if self.room.mentionable(c.name).lower() == name])
|
if self.room.mentionable(c.name).lower() == name])
|
||||||
|
|
||||||
elif "list" in options:
|
elif "list" in options:
|
||||||
if options["list"] is True or options["list"] == "all":
|
if options["list"] is True or options["list"] == "all":
|
||||||
clients = self.room.get_sessions()
|
clients = self.room.s
|
||||||
elif options["list"] == "people":
|
elif options["list"] == "people":
|
||||||
clients = self.room.get_people()
|
clients = self.room.get_people()
|
||||||
elif options["list"] == "bots":
|
elif options["list"] == "bots":
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue