diff options
author | John Smith <mrdoctorwho@helldev.net> | 2020-10-23 18:43:49 +0300 |
---|---|---|
committer | John Smith <mrdoctorwho@helldev.net> | 2020-10-23 18:43:49 +0300 |
commit | e379c936d17b0af2eb50efbf5f9d39a5e35a0ee8 (patch) | |
tree | 9fdf57d6e3831167e9d6339f4cb6a356aace5319 | |
parent | e8c4d095e1abf3a64583e5395f6d5a48922b0dd2 (diff) |
Make CHAT_USERS_LIMIT global
-rw-r--r-- | extensions/groupchats.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/extensions/groupchats.py b/extensions/groupchats.py index aa4fff1..47e6f1b 100644 --- a/extensions/groupchats.py +++ b/extensions/groupchats.py @@ -408,7 +408,7 @@ class Chat(object): """ chat = user.vk.method("messages.getChat", {"chat_id": id}) users = chat.get("users", []) - users = sorted(users[:CHAT_USERS_LIMIT]) + users = sorted(users)[:CHAT_USERS_LIMIT] if not chat: raise RuntimeError("Unable to get a chat!") return chat @@ -560,6 +560,7 @@ def initChatExtension(): else: logger.warning("not starting chats cleaner because CHAT_LIFETIME_LIMIT is not set") if not isdef("CHAT_USERS_LIMIT"): + global CHAT_USERS_LIMIT CHAT_USERS_LIMIT = 50 |