bot.exts.info.github
#
Get data from GitHub.
Module Contents#
Classes#
Dataclass representing an issue found by the regex. |
|
Dataclass representing an error while fetching an issue. |
|
Dataclass representing the state of an issue. |
|
A Cog that fetches info from GitHub. |
Functions#
|
Load the GithubInfo cog. |
Attributes#
- bot.exts.info.github.REPOSITORY_ENDPOINT = 'https://api.github.com/orgs/{org}/repos?per_page=100&type=public'[source]#
- bot.exts.info.github.ISSUE_ENDPOINT = 'https://api.github.com/repos/{user}/{repository}/issues/{number}'[source]#
- bot.exts.info.github.PR_ENDPOINT = 'https://api.github.com/repos/{user}/{repository}/pulls/{number}'[source]#
- class bot.exts.info.github.FetchError[source]#
Dataclass representing an error while fetching an issue.
- class bot.exts.info.github.Github(bot: bot.bot.Bot)[source]#
Bases:
discord.ext.commands.Cog
A Cog that fetches info from GitHub.
- async fetch_issue(number: int, repository: str, user: str) IssueState | FetchError [source]#
Retrieve an issue from a GitHub repository.
Returns IssueState on success, FetchError on failure.
- static format_embed(results: list[IssueState | FetchError]) discord.Embed [source]#
Take a list of IssueState or FetchError and format a Discord embed for them.
- async github_group(ctx: discord.ext.commands.Context) None [source]#
Commands for finding information related to GitHub.
- async on_message(message: discord.Message) None [source]#
Automatic issue linking.
Listener to retrieve issue(s) from a GitHub repository using automatic linking if matching <org>/<repo>#<issue>.
- async fetch_data(url: str) tuple[dict[str], aiohttp.ClientResponse] [source]#
Retrieve data as a dictionary and the response in a tuple.
- async bot.exts.info.github.setup(bot: bot.bot.Bot) None [source]#
Load the GithubInfo cog.