Add version information display for tracked Modrinth projects. Embed current version details and changelog in the tracking channel, with fallback message for unavailable data.
Some checks are pending
Run pre-commit / Run pre-commit (push) Waiting to run
Some checks are pending
Run pre-commit / Run pre-commit (push) Waiting to run
This commit is contained in:
parent
e64a1e2536
commit
767d656c8d
1 changed files with 13 additions and 0 deletions
|
@ -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)}")
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue