News: Fix interaction timeouting

This commit is contained in:
Daniel Skýpala 2024-03-09 18:30:34 +01:00
parent 424078deff
commit 8fcc250041

View file

@ -107,10 +107,11 @@ class News(commands.Cog):
@news.command(description="Posts news of given id to set channel.") @news.command(description="Posts news of given id to set channel.")
@discord.option("id", str, description="Id of entry to send.", autocomplete=autocomplete_news_ids) @discord.option("id", str, description="Id of entry to send.", autocomplete=autocomplete_news_ids)
async def post_news(self, ctx, id: int): async def post_news(self, ctx, id: int):
await ctx.defer(ephemeral=True)
err = await post_news(self.bot, ctx.guild, id) err = await post_news(self.bot, ctx.guild, id)
if err: if err:
return await ctx.respond(err, ephemeral=True) return await ctx.respond(err, ephemeral=True)
return await ctx.respond(f"News posted.", ephemeral=True) return await ctx.respond(f"News posted.")
def setup(bot): def setup(bot):