Skip to content

Conversation

@jb3
Copy link
Member

@jb3 jb3 commented Nov 9, 2025

Copies over the source command from bot, including functionality that allows for tag parsing on bot.

Closes #306

@jb3 jb3 force-pushed the 12.x-source-code-command branch from 2058c10 to a7817f0 Compare November 9, 2025 22:30
@jb3 jb3 force-pushed the 12.x-source-code-command branch from 57016b4 to 1195653 Compare November 9, 2025 23:23
@jb3 jb3 linked an issue Nov 9, 2025 that may be closed by this pull request
@jb3 jb3 requested a review from onerandomusername November 9, 2025 23:29
Comment on lines +69 to +75
if not source_item:
embed = Embed(title=f"{self.bot.user.name}'s GitHub Repository")
embed.add_field(name="Repository", value=f"[Go to GitHub]({self.github_repo})")
embed.set_thumbnail(url=GITHUB_AVATAR)
await ctx.send(embed=embed)
return

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thoughts on adding a link to bot core as well here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noise for most use cases, pydis_core is never really relevant to those outside PyDis (hence we don't really widely promote it).

Supporting commands from pydis_core is about the most we should support I think.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of time someone looking at the source command is trying to contribute and looking at how commands are implemented. Giving a link to where other commands are implemented is a benefit and intent of the source command, IMO.

If a user is using the bot's source command, they're already interested in how it works, and surfacing bot-core is an important part of how the pydis bots work.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a nice way to include this without fundamentally complicating what is a simple feature that hundreds of bots have.

If someone else feels passionately that we should include it, then sure, but the whole point here is to try and transparently carry across functionality from the current command, which obviously does not mention pydis_core.


if source_type == _SourceType.core_command or source_type == _SourceType.core_cog:
version = f"v{metadata.version('pydis_core')}"
elif sha := os.getenv("GITHUB_SHA"):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could be provided as a setup variable with a default of "main"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could, but this works with our current bots without change on their side. Just seems easier and is guaranteed to work for our use cases.

Setup for the bot core instance is already massive.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough, I think. Unified configuration should help this some.

@jb3 jb3 force-pushed the 12.x-source-code-command branch from c1a1841 to d2bb444 Compare November 10, 2025 00:01
@jb3 jb3 changed the title Provide a pre-built SourceCode cog based on bot version Provide a pre-built SourceCode cog Nov 10, 2025
@jb3 jb3 force-pushed the 12.x-source-code-command branch from 6cbc7f9 to 3b5c355 Compare November 10, 2025 19:45
@jb3 jb3 force-pushed the 12.x-source-code-command branch from 3b5c355 to 2fa5aa2 Compare November 10, 2025 23:19
@jb3 jb3 merged commit 2fa5aa2 into 12.x Nov 10, 2025
7 checks passed
@jb3 jb3 deleted the 12.x-source-code-command branch November 10, 2025 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Port source command to botcore optionally

4 participants