Skip to content

Commit

Permalink
v1.1.1-alpha
Browse files Browse the repository at this point in the history
adds active users to bottom of panel
  • Loading branch information
Ferrariic committed Jul 13, 2022
1 parent 7e6c52f commit 3b7254d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,24 @@ async def on_message(message):


async def run_active_queues():
route = (
queue_route = (
config.BASE + f"V1/discord/get-active-queues?token={config.DISCORD_ROUTE_TOKEN}"
)
connections_route = config.BASE + f"V1/server-status/connections"

response = await get_url(route=route)
response = await get_url(route=queue_route)
connections = await get_url(route=connections_route)
channel = client.get_channel(config.ACTIVE_QUEUES_CHANNEL)
messages = await channel.history(limit=5).flatten()

embed = discord.Embed(
title="Active Queues", description=f"Updated: <t:{int(time.time())}:R>"
)
minute_connections = connections["minute_connections"]
hour_connections = connections["hour_connections"]
embed = embed.set_footer(
text=f"Active Users: {minute_connections} | Past Hour: {hour_connections}"
)

if "detail" in response.keys():
if response["detail"] == "bad token":
Expand Down

0 comments on commit 3b7254d

Please sign in to comment.