Merge pull request 'Add break readout for the bot-aux' (#2) from gabby-dev into main
All checks were successful
test and deploy / test (3.11.5) (push) Successful in 1m45s
test and deploy / push-and-build (push) Successful in 33s

Reviewed-on: #2
This commit is contained in:
2025-12-23 13:15:05 +00:00

View File

@@ -36,11 +36,22 @@ async def on_ready():
print(f'{client.user} has connected.')
print(args.guild_id)
guild: discord.Guild = client.get_guild(args.guild_id)
channel: discord.TextChannel = guild.get_channel(args.channel_id)
callouts = DATABASE_CONN.query_callouts(NUMBER_OF_DAYS)
formatted_callouts = DATABASE_CONN.formatted_list_of_callouts(callouts)
output = f'Callouts for the next {NUMBER_OF_DAYS} days:\n' + formatted_callouts
output += '\n\n'
output += f'Breaks for the next {NUMBER_OF_DAYS} days:\n'
breaks: str = DATABASE_CONN.query_breaks(NUMBER_OF_DAYS)
formatted_breaks: str = DATABASE_CONN.formatted_list_of_breaks(breaks)
output += formatted_breaks
await channel.send(output)
await client.close() # Another way to exit, a little bit cleaner than exit(0)
return