From 767d656c8d93523aa1e845c56015d752040495bc Mon Sep 17 00:00:00 2001 From: Valerie Date: Fri, 23 May 2025 05:05:29 -0400 Subject: [PATCH] Add version information display for tracked Modrinth projects. Embed current version details and changelog in the tracking channel, with fallback message for unavailable data. --- modrinthtracker/modrinthtracker.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modrinthtracker/modrinthtracker.py b/modrinthtracker/modrinthtracker.py index a8e0d51..4fc3da3 100644 --- a/modrinthtracker/modrinthtracker.py +++ b/modrinthtracker/modrinthtracker.py @@ -68,6 +68,19 @@ class ModrinthTracker(commands.Cog): await self.config.guild(ctx.guild).tracked_projects.set(tracked_projects) await ctx.send(f"Now tracking {project_data['title']} (`{project_id}`) in {channel.mention}.") + # Post the current version information + if latest_version: + embed = discord.Embed( + title=f"Current Version of {project_data['title']}", + description=f"Version: {latest_version.get('version_number', 'Unknown')}\n\n{latest_version.get('changelog', 'No changelog provided')}", + url=f"https://modrinth.com/project/{project_id}", + color=discord.Color.blue(), + timestamp=datetime.now() + ) + await channel.send(embed=embed) + else: + await channel.send("No version information is currently available for this project.") + except Exception as e: await ctx.send(f"An error occurred while adding the project: {str(e)}")