filter system message on last message
This commit is contained in:
parent
941cbba66d
commit
fd2b60bfe8
1 changed files with 4 additions and 3 deletions
|
@ -41,12 +41,13 @@ def main():
|
|||
|
||||
print("Check messages for channels {}".format(channel['name']))
|
||||
messages = rocket.channels_history(channel["_id"], oldest= recent_date, count= 10000).json()
|
||||
if messages["success"]:
|
||||
nbMessages = len(messages["messages"])
|
||||
if messages["success"]:
|
||||
messages = list(filter(lambda message: "t" not in message, messages["messages"]))
|
||||
nbMessages = len(messages)
|
||||
messages_recent += nbMessages
|
||||
if (channel["name"] != "general") and (channel["name"] != "accueil"):
|
||||
channels_list.append((channel["name"], nbMessages))
|
||||
users.extend(map(lambda message: message["u"]["_id"], messages["messages"]))
|
||||
users.extend(map(lambda message: message["u"]["_id"], messages))
|
||||
else:
|
||||
print("Error : {}".format(messages["error"]))
|
||||
|
||||
|
|
Loading…
Reference in a new issue