modify epglist format

This commit is contained in:
deflax 2024-01-17 05:51:35 +02:00
parent 9f6ae93762
commit 8010861107

View file

@ -52,11 +52,13 @@ async def epg(ctx):
global database global database
await ctx.channel.send('epg:') await ctx.channel.send('epg:')
if database != {}: if database != {}:
epg_list = ""
for key, value in database.items(): for key, value in database.items():
item_name = value['name'] item_name = value['name']
item_start = value['start_at'] item_start = value['start_at']
if item_start != 'now' and item_start != 'never': if item_start != 'now' and item_start != 'never':
await ctx.channel.send(f'{item_name} starts at {item_start}h UTC') epg_list += f'{item_name} starts at {item_start}h UTC\n')
await ctx.channel.send(f'``` {epg_list} ```')
else: else:
await ctx.channel.send('Empty database!') await ctx.channel.send('Empty database!')