From 7eb64ca96e9ad80b5d1ddacbf2ba66824ae1d521 Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Sun, 9 Apr 2017 12:26:09 -0700 Subject: [PATCH] 60 seconds for unauth user to show embed users --- titanembeds/blueprints/api/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/titanembeds/blueprints/api/api.py b/titanembeds/blueprints/api/api.py index 4d7d8ef..0091798 100644 --- a/titanembeds/blueprints/api/api.py +++ b/titanembeds/blueprints/api/api.py @@ -180,7 +180,7 @@ def get_guild_channels(guild_id): if result["read"]: result_channels.append(result) - return sorted(result_channels, key=lambda k: k['channel']['position']) + return sorted(result_channels, key=lambda k: k['channel']['position']) def filter_guild_channel(guild_id, channel_id): channels = get_guild_channels(guild_id) @@ -194,7 +194,7 @@ def get_online_discord_users(guild_id): return embed['members'] def get_online_embed_users(guild_id): - time_past = (datetime.datetime.now() - datetime.timedelta(seconds = 120)).strftime('%Y-%m-%d %H:%M:%S') + time_past = (datetime.datetime.now() - datetime.timedelta(seconds = 60)).strftime('%Y-%m-%d %H:%M:%S') unauths = db.session.query(UnauthenticatedUsers).filter(UnauthenticatedUsers.last_timestamp > time_past, UnauthenticatedUsers.revoked == False, UnauthenticatedUsers.guild_id == guild_id).all() auths = db.session.query(AuthenticatedUsers).filter(AuthenticatedUsers.last_timestamp > time_past, AuthenticatedUsers.guild_id == guild_id).all() users = {'unauthenticated':[], 'authenticated':[]}