Merge pull request 'Add break readout for the bot-aux' (#2) from gabby-dev into main
Reviewed-on: #2
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user