A high-level framework for building GitHub applications in Python.
aiohttp_remotes
.pip install sapid
pip install git+https://github.com/justanotherbyte/sapid
pip install sapid[proxy-support]
from sapid import GitBot
bot = GitBot(
pem_file_fp="bot.pem",
app_id="...", # Found on github.
webhook_secret="...", # Set on github.
client_secret="..." # Generate on github.
)
@bot.event
async def on_sapid_tcp_ready(host, port):
print(f"tcp running on http://{host}:{port}")
print(bot.user.name)
print(bot.user.description)
bot.run(host="127.0.0.1", port=3000)
I know this isn't something you'd usually do, but hey, it showcases something.
from sapid import GitBot, Repository, IssueLockReason
bot = GitBot(
pem_file_fp="bot.pem",
app_id="...", # Found on github.
webhook_secret="...", # Set on github.
client_secret="..." # Generate on github.
)
@bot.event
async def on_repository_star_update(action: str, repo: Repository):
issue = await repo.fetch_issue(1)
await issue.create_comment("Hello! Locking Issue")
await issue.lock(reason=IssueLockReason.TOO_HEATED)
Author: justanotherbyte
Source: https://github.com/justanotherbyte/sapid