Fix not finding embeds

This commit is contained in:
Nexus 2024-04-19 16:30:39 +01:00 committed by GitHub
parent c01698c775
commit 827bdf293f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -769,7 +769,7 @@ class OtherCog(commands.Cog):
await ctx.defer() await ctx.defer()
async with self.transcribe_lock: async with self.transcribe_lock:
if not message.attachments: if not message.attachments and not message.embeds:
return await ctx.respond("No attachments found.") return await ctx.respond("No attachments found.")
_ft = "wav" _ft = "wav"
@ -779,7 +779,7 @@ class OtherCog(commands.Cog):
break break
else: else:
for embed in message.embeds: for embed in message.embeds:
if embed.type == "video" and embed.video.url.split(".")[-1] in ("mp4", "webm"): if embed.type == "video" and embed.video.url.endswith(("mp4", "webm")):
_ft = embed.video.split(".")[-1] _ft = embed.video.split(".")[-1]
attachment = FakeAttachment(embed.video.proxy_url, embed.video.url) attachment = FakeAttachment(embed.video.proxy_url, embed.video.url)
break break