From adaec4251057ff4c66cacd251afc55f185492918 Mon Sep 17 00:00:00 2001 From: kevincaires Date: Thu, 1 Sep 2022 20:16:15 -0300 Subject: [PATCH] ADD news command. --- utils/commands.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/utils/commands.py b/utils/commands.py index 3a004e4..e26daf9 100644 --- a/utils/commands.py +++ b/utils/commands.py @@ -322,9 +322,10 @@ async def news(bot: object) -> None: embed = Embed(type='rich') for new in news: + # TODO: Descomentar o código do match case dt = datetime.fromisoformat(new['publishedAt']) - embed.add_field(name='Published at', value=dt.date().isoformat(), inline=False) + embed.add_field(name='Published at', value=dt.isoformat(), inline=False) embed.add_field(name='link', value=new['url'], inline=False) embed.add_field(name=new['title'], value=new['description'], inline=False) - embed.add_field(name='Img', value=new['urlToImage']) - await bot.send(f'**`{new["source"]["name"]}`**', embed=embed) + + return await bot.send(f'**`{new["source"]["name"]}`**', embed=embed)