Skip to content

Commit

Permalink
Keep original IMDb embeds for shows
Browse files Browse the repository at this point in the history
  • Loading branch information
stekc committed Oct 10, 2024
1 parent 2161758 commit 05d3f42
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions cogs/movies.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,30 @@ async def on_message(self, message: discord.Message):
movie = await self.get_movie_data(link)

if movie:
embed, view = await self.process_movie_data(movie, is_imdb_link=True)
await message.reply(embed=embed, view=view)
await self.config_cog.increment_link_fix_count("imdb")
await asyncio.sleep(0.75)
await message.edit(suppress=True)
if "Images" in movie:
embed, view = await self.process_movie_data(
movie, is_imdb_link=True
)
await message.reply(embed=embed, view=view)
await self.config_cog.increment_link_fix_count("imdb")
await asyncio.sleep(0.75)
await message.edit(suppress=True)
else:
view = View(timeout=604800)
stremio_url = f"https://keto.boats/stremio?id={movie['ImdbId']}"
if movie.get("IsTVSeries", False):
stremio_url += "&series=true"

view.add_item(
discord.ui.Button(
style=discord.ButtonStyle.link,
label="Open in Stremio",
emoji="<:stremio:1292976659829362813>",
url=stremio_url,
)
)
await message.reply(view=view)
await self.config_cog.increment_link_fix_count("imdb")

@commands.hybrid_command(
name="movie",
Expand Down

0 comments on commit 05d3f42

Please sign in to comment.