fix(voicefix): Don't delete webhook on update.
This commit is contained in:
@@ -436,7 +436,10 @@ class VoiceFixCog(LionCog):
|
|||||||
return
|
return
|
||||||
|
|
||||||
hook = discord.Webhook.from_url(webhook, client=self.bot)
|
hook = discord.Webhook.from_url(webhook, client=self.bot)
|
||||||
await self.data.LinkHook.table.delete_where(channelid=channel.id)
|
existing = await self.data.LionHook.fetch(channel.id)
|
||||||
|
if existing:
|
||||||
|
await existing.update(webhookid=hook.id, token=hook.token)
|
||||||
|
else:
|
||||||
await self.data.LinkHook.create(
|
await self.data.LinkHook.create(
|
||||||
channelid=channel.id,
|
channelid=channel.id,
|
||||||
webhookid=hook.id,
|
webhookid=hook.id,
|
||||||
|
|||||||
Reference in New Issue
Block a user