Skip to content

Commit

Permalink
Merge pull request #12 from NeverScapeAlone/v1.1.1-alpha
Browse files Browse the repository at this point in the history
v1.1.1-alpha
  • Loading branch information
Ferrariic authored Jul 13, 2022
2 parents 7e6c52f + 3b7254d commit f1926ba
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 f1926ba

Please sign in to comment.