From 805ce3e85aba87e53e902b72575e9cbfcdf7d9d2 Mon Sep 17 00:00:00 2001 From: Interitio Date: Thu, 9 Nov 2023 13:16:24 +0200 Subject: [PATCH] feat(voicefix): Add manual webhook update. --- cog.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/cog.py b/cog.py index 1070340..a3c8c7a 100644 --- a/cog.py +++ b/cog.py @@ -426,3 +426,21 @@ class VoiceFixCog(LionCog): ) # TODO: May want paging if over 25 links.... await ctx.reply(embed=embed) + + @linker_group.command( + name="webhook", + description='Manually configure the webhook for a given channel.' + ) + async def linker_webhook(self, ctx: LionContext, channel: discord.abc.GuildChannel, webhook: str): + if not ctx.interaction: + return + + hook = discord.Webhook.from_url(webhook, client=self.bot) + await self.data.LinkHook.table.delete_where(channelid=channel.id) + await self.data.LinkHook.create( + channelid=channel.id, + webhookid=hook.id, + token=hook.token, + ) + self.hooks[channel.id] = hook + await ctx.reply(f"Webhook for {channel.mention} updated!")