.BANCHO. Add !report command

This commit is contained in:
Nyo
2016-12-11 23:12:06 +01:00
parent b4d498c26c
commit daf457fc5c
5 changed files with 104 additions and 7 deletions

View File

@@ -402,13 +402,15 @@ class Client:
self.replyCode(332, description, channel=channel)
# Build connected users list
users = glob.channels.channels[channel].connectedUsers[:]
if "chat/{}".format(channel) not in glob.streams.streams:
self.reply403(channel)
continue
users = glob.streams.streams["chat/{}".format(channel)].clients
usernames = []
for user in users:
token = glob.tokens.getTokenFromUserID(user)
if token is None:
if user not in glob.tokens.tokens:
continue
usernames.append(chat.fixUsernameForIRC(token.username))
usernames.append(chat.fixUsernameForIRC(glob.tokens.tokens[user].username))
usernames = " ".join(usernames)
# Send IRC users list