Skip to content

Source command#955

Merged
MarkKoz merged 43 commits into
python-discord:masterfrom
ks129:source-command
Jul 20, 2020
Merged

Source command#955
MarkKoz merged 43 commits into
python-discord:masterfrom
ks129:source-command

Conversation

@ks129
Copy link
Copy Markdown
Contributor

@ks129 ks129 commented May 20, 2020

Closes #331

Created !source command, that supports 3 types of source items: Help command, command, cog. Send embed that has a link to GitHub, help text of the item and when command/cog, are you able to run it in this context.

@ks129 ks129 requested a review from a team as a code owner May 20, 2020 06:21
@ks129 ks129 requested review from eivl and tagptroll1 and removed request for a team May 20, 2020 06:21
@Numerlor
Copy link
Copy Markdown
Contributor

Before a proper review,
The embed when not found could use some text instead of just being empty like that.
source_embed

And what's the reason for the two identical links in the title and the footer?

ks129 added 5 commits May 20, 2020 16:23
- Renamed cog from `Source` to `BotSource` for itself (bot will be
unable to get cog, because this always return command).
- Moved checks status from footer to field and changed it's content.
@ks129
Copy link
Copy Markdown
Contributor Author

ks129 commented May 20, 2020

@Numerlor Is this better now? I removed the link from the title and made converter raising BadArgument instead just sending bot repo when invalid argument provided.

@MarkKoz MarkKoz added a: information Related to information commands: (doc, help, information, reddit, site, tags) p: 3 - low Low Priority t: feature New feature or request status: needs review labels May 22, 2020
Copy link
Copy Markdown
Contributor

@MarkKoz MarkKoz left a comment

Choose a reason for hiding this comment

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

  • !source accept doesn't work - it triggers an InWhitelistCheckFailure. The source command should avoid triggering any checks.
  • Could you make aliases defined in alias.py resolve to their actual commands when used with !source?
  • Is it possible to make this work for the tag aliases? It could link to the markdown files.

Comment thread bot/cogs/source.py Outdated
Comment thread bot/cogs/source.py Outdated
Comment thread bot/cogs/source.py Outdated
Comment thread bot/cogs/source.py Outdated
Comment thread bot/cogs/source.py Outdated
Comment thread bot/cogs/source.py Outdated
Comment thread bot/cogs/source.py Outdated
Comment thread bot/cogs/source.py Outdated
Comment thread bot/cogs/source.py Outdated
Comment thread bot/cogs/source.py Outdated
@MarkKoz MarkKoz added s: waiting for author Waiting for author to address a review or respond to a comment and removed status: needs review labels May 31, 2020
ks129 and others added 2 commits May 31, 2020 08:26
@ks129 ks129 requested a review from MarkKoz June 1, 2020 05:22
Comment thread bot/cogs/source.py Outdated
@ghost ghost added needs 1 review and removed s: waiting for author Waiting for author to address a review or respond to a comment needs 1 approval labels Jun 10, 2020
Comment thread bot/cogs/source.py
@ghost ghost added s: waiting for author Waiting for author to address a review or respond to a comment and removed needs 2 approvals labels Jun 18, 2020
Comment thread bot/cogs/source.py
src = source_item.callback.__code__
filename = src.co_filename
elif isinstance(source_item, str):
tags_cog = self.bot.get_cog("Tags")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Technically, the cog could be unloaded between when the converter is used and this part of the code is reached. But this is an edge case that I don't think we should worry about, as it would overcomplicate the code.

@ghost ghost added needs 2 approvals and removed s: waiting for author Waiting for author to address a review or respond to a comment labels Jun 18, 2020
@ks129 ks129 requested a review from MarkKoz June 18, 2020 05:17
Comment thread bot/cogs/source.py Outdated
Comment thread bot/cogs/source.py Outdated
Copy link
Copy Markdown
Contributor

@Senjan21 Senjan21 left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

@ghost ghost removed the needs 1 approval label Jul 20, 2020
@MarkKoz MarkKoz merged commit c1a4a30 into python-discord:master Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: information Related to information commands: (doc, help, information, reddit, site, tags) p: 3 - low Low Priority t: feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Source command.

4 participants