Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
c0f4b10
first partial draft of github refactor
onerandomusername Oct 31, 2025
c990812
Use embeds, they're nicer
onerandomusername Oct 31, 2025
7061c50
refactor to get embeds(), validate resource number
onerandomusername Oct 31, 2025
f8b10da
issue comment support
onerandomusername Oct 31, 2025
3d1861f
support pull request review comments
onerandomusername Nov 1, 2025
4175a47
sort by repo, better embeds
onerandomusername Nov 1, 2025
369417b
feat: support discussions and discussion shortcoding
onerandomusername Nov 1, 2025
d69a3f9
feat: add asyncio.gather support
onerandomusername Nov 1, 2025
ce19480
feat: add discussion comments
onerandomusername Nov 1, 2025
62c4685
fix: simply check for handler being none regarding asyncio.gather
onerandomusername Nov 1, 2025
8e2d47f
add proper support for urls for github review comments
onerandomusername Nov 1, 2025
e7ca2d7
move back to ghretos git version
onerandomusername Nov 1, 2025
c2503a1
same title
onerandomusername Nov 1, 2025
345f2c5
feat: full-size modal support
onerandomusername Nov 1, 2025
6aaf243
feat: make a basic github info slash command
onerandomusername Nov 1, 2025
628216e
feat: add button to bottom of slash command invokes
onerandomusername Nov 1, 2025
a9a70c3
fix limits of message lens sometimes being too long
onerandomusername Nov 1, 2025
8d43967
fix: show validated data as name
onerandomusername Nov 1, 2025
8158152
fix: support issues moved from repo to repo
onerandomusername Nov 1, 2025
a166c89
fix: add integration with existing configuration and feature set
onerandomusername Nov 1, 2025
c929f6e
use project.dependencies to define ghretos dependency
onerandomusername Nov 1, 2025
61dfb19
fix: update github colours to match github branding
onerandomusername Nov 2, 2025
4d7718c
use the same colours discord github webhooks use for comments
onerandomusername Nov 2, 2025
43ec13a
add proper discussion emojis
onerandomusername Nov 2, 2025
3b281b1
fix attribute reference for github colours
onerandomusername Nov 3, 2025
ebfceae
feat: add very basic user and repo renderables and =gh user/repo command
onerandomusername Nov 3, 2025
6ed8616
fix: handle 404 errors from untrusted input
onerandomusername Nov 3, 2025
ccf3d77
fix: use different discussion emoji when discussion is answered
onerandomusername Nov 3, 2025
5491952
regen commands lists
onerandomusername Nov 3, 2025
ee5ab41
fix type error from rebase
onerandomusername Nov 3, 2025
9e6e31d
fix: show proper emojis for closed/locked/skipped issues and discussions
onerandomusername Nov 4, 2025
6a2a62f
fix: lighten up the muted gh colour
onerandomusername Nov 4, 2025
a7d6974
restore the github ratelimit command
onerandomusername Nov 5, 2025
199b29d
fix typing issues
onerandomusername Nov 5, 2025
f3f3b6d
fix: properly handle mannequin and ghost objects
onerandomusername Nov 5, 2025
1a7e598
fix: support issues/pulls/discussions being used interchangeably
onerandomusername Nov 5, 2025
569b018
feat: even smaller small renderables
onerandomusername Nov 5, 2025
2422722
cache 404s and 410s
onerandomusername Nov 5, 2025
b1442d9
fix: only cache 404s and 410s for 2 hours|a day
onerandomusername Nov 5, 2025
a1900f2
fix: strip titles
onerandomusername Nov 5, 2025
2c68278
fix: limit embed titles to 256 characters
onerandomusername Nov 5, 2025
9750923
Update monty/exts/info/github/_handlers.py
onerandomusername Nov 5, 2025
0bbba12
fix: casefold repo names when deduping
onerandomusername Nov 7, 2025
4031624
dedupe and sort final repo snippets before sending
onerandomusername Nov 7, 2025
fa6567c
update ghretos
onerandomusername Nov 7, 2025
41ba54a
casefold repo name and owner when determining to show owner and repo …
onerandomusername Nov 7, 2025
a4b5518
fix: only recheck parsed if it's different from the original provided
onerandomusername Nov 7, 2025
59164b6
fix: provide typename to discussion comment
onerandomusername Nov 7, 2025
bc7c1d4
fix: dedupe resources when parsing
onerandomusername Nov 7, 2025
fcd4dc4
feat(github): add message edit listener
onerandomusername Nov 9, 2025
c8c7f76
fix: gate autolinks behind permissions
onerandomusername Nov 9, 2025
21a0cfd
content has been sorted elsewhere
onerandomusername Nov 9, 2025
d7f7c2a
Fix emoji assignment for closed pull requests
onerandomusername Nov 9, 2025
963e50d
fix: show error embed to user and add it to the cache
onerandomusername Nov 10, 2025
8814d21
update cog load docstring
onerandomusername Nov 10, 2025
ed32b7a
fix: display ratelimits as timestamps
onerandomusername Nov 10, 2025
1ea21e5
move github cog to cog file
onerandomusername Nov 12, 2025
7407633
refactor: move github fetching to seperate file
onerandomusername Nov 12, 2025
239c6f7
fix: invoke help command on no args to github
onerandomusername Nov 12, 2025
048c951
fix discussion urls
onerandomusername Nov 12, 2025
2359607
feat: use github search for issue and repo linking
onerandomusername Nov 19, 2025
96d65f6
feat: enable repos and users in github info command
onerandomusername Nov 19, 2025
393e51d
fix: use error handler for all github errors
onerandomusername Nov 19, 2025
995bcbd
add a couple other aliases
onerandomusername Nov 19, 2025
6425fba
chore: run autodoc
onerandomusername Nov 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/commands/app-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,16 +246,16 @@ bots.

Fetches info from GitHub.

### `github`
### `github info`

- `arg` (`string`) (required) Can be a org/repo#number, a link to an issue or
issue comment, and more.
- `arg` (`string`) (required) The GitHub resource to view . Can be a URL or
shorthand like owner/repo#issue_number.

View information about an issue, pull, discussion, or comment on GitHub.
Fetch GitHub information.

**Usable in:** `Guilds`, `Bot DMs`, `Private Channels`

**Installable as:** `Guild`
**Installable as:** `Guild`, `User`

## Guild Config

Expand Down
24 changes: 8 additions & 16 deletions docs/commands/prefix-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,29 +141,21 @@ Management commands for bot features.

Fetches info from GitHub.

### `github [user_or_repo=]`
### `github [args...]`

*Commands for finding information related to GitHub.*
*Group for GitHub related commands.*

**Can also use:** `gh`, `git`
**Can also use:** `gh`

### `github issue <numbers> <repo> [user=None]`
### `github repo <user_and_repo> [repo=]`

*Command to retrieve issue(s) from a GitHub repository.*
*Fetch GitHub repository information.*

**Can also use:** `github pr`, `github pull`
**Can also use:** `github repo_info`, `github repository`

### `github repository [repository...]`
### `github user <user>`

*Fetches a repositories' GitHub information.*

**Can also use:** `github repo`, `repo`

### `github user <username>`

*Fetches a user's GitHub information.*

**Can also use:** `github userinfo`
*Fetch GitHub user information.*

## Help

Expand Down
28 changes: 26 additions & 2 deletions monty/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ class GHColour(int, enum.Enum):
attention = 0x9A6700
default = 0x1F2328

# These are used by Discord
issue_comment = 0xE68D60
pull_comment = 0xBFE5BF


## DEPRECATED
# TODO: Will be replaced in favour of application emojis
Expand Down Expand Up @@ -329,6 +333,11 @@ class AppEmojisCls(BaseModel, arbitrary_types_allowed=True):
file_name="discussion-closed",
color=GHColour.done,
)
discussion_closed_unresolved: AppEmojiAnn = Octicon(
name="gh-discussion-closed-unresolved",
file_name="comment-discussion",
color=GHColour.muted,
)
discussion_outdated: AppEmojiAnn = Octicon(
name="gh-discussion-outdated",
file_name="discussion-outdated",
Expand All @@ -349,8 +358,18 @@ class AppEmojisCls(BaseModel, arbitrary_types_allowed=True):
file_name="issue-closed",
color=GHColour.done,
)
issue_closed_generic: AppEmojiAnn = Octicon(
name="gh-skip",
file_name="skip",
color=GHColour.muted,
)
issue_closed_unplanned: AppEmojiAnn = Octicon(
name="gh-issue-closed-unplanned",
name="gh-skip",
file_name="skip",
color=GHColour.muted,
)
issue_closed_duplicate: AppEmojiAnn = Octicon(
name="gh-skip",
file_name="skip",
color=GHColour.muted,
)
Expand Down Expand Up @@ -395,9 +414,14 @@ class Feature(enum.Enum):
DISCORD_TOKEN_REMOVER = "DISCORD_BOT_TOKEN_FILTER" # noqa: S105
DISCORD_WEBHOOK_REMOVER = "DISCORD_WEBHOOK_FILTER"
GITHUB_COMMENT_LINKS = "GITHUB_EXPAND_COMMENT_LINKS"
"Controls whether or not GitHub comment links are expanded into embeds. Requires GITHUB_ISSUE_LINKS to be enabled."
GITHUB_DISCUSSIONS = "GITHUB_AUTOLINK_DISCUSSIONS"
GITHUB_ISSUE_EXPAND = "GITHUB_AUTOLINK_ISSUE_SHOW_DESCRIPTION"
"Controls whether or not GitHub Discussions are automatically linked. Requires GITHUB_ISSUE_LINKS to be enabled."
GITHUB_ISSUE_LINKS = "GITHUB_EXPAND_ISSUE_LINKS"
"Controls whether or not GitHub embeds are replaced with Monty's Embeds."
# Deprecated, NO-OP
GITHUB_ISSUE_EXPAND = "GITHUB_AUTOLINK_ISSUE_SHOW_DESCRIPTION"
"Controls whether or not GitHub Embeds are expanded to show more information. Requires GITHUB_ISSUE_LINKS."
GLOBAL_SOURCE = "GLOBAL_SOURCE_COMMAND"
INLINE_DOCS = "INLINE_DOCUMENTATION"
INLINE_EVALULATION = "INLINE_EVALULATION"
Expand Down
12 changes: 12 additions & 0 deletions monty/exts/info/github/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from .cog import GithubInfo


TYPE_CHECKING = 0

if TYPE_CHECKING:
from monty.bot import Monty


def setup(bot: "Monty") -> None:
"""Setup the Github Info cog."""
bot.add_cog(GithubInfo(bot))
Loading