🚸 adapt to latest version

This commit is contained in:
yanyongyu 2021-08-04 14:32:13 +08:00
parent 40643236e0
commit 9cc2052086
4 changed files with 10 additions and 11 deletions

View File

@ -4,7 +4,7 @@
@Author : yanyongyu
@Date : 2020-09-20 23:59:20
@LastEditors : yanyongyu
@LastEditTime : 2021-03-15 23:10:18
@LastEditTime : 2021-08-04 13:39:45
@Description : GitHub Main Plugin
@GitHub : https://github.com/yanyongyu
"""
@ -13,12 +13,13 @@ __author__ = "yanyongyu"
from pathlib import Path
import nonebot
from redis import Redis
from .config import Config
# nonebot2 < 2.0.0-alpha.14
# quote with double quotes to use generic typing provided by pylance
redis: "Redis[bytes]" = nonebot.require("redis_provider").redis
# redis: "Redis[bytes]" = nonebot.require("redis_provider").redis
from src.plugins.redis_provider import redis_client as redis
# store all github subplugins
_sub_plugins = set()

View File

@ -4,7 +4,7 @@
@Author : yanyongyu
@Date : 2021-03-15 20:18:19
@LastEditors : yanyongyu
@LastEditTime : 2021-06-14 01:25:35
@LastEditTime : 2021-08-04 13:40:25
@Description : None
@GitHub : https://github.com/yanyongyu
"""
@ -19,7 +19,7 @@ except ImportError:
pass
else:
app: FastAPI = nonebot.get_driver().server_app
app: FastAPI = nonebot.get_app()
@app.get("/api/github/auth")
async def auth(code: str, state: str):

View File

@ -4,7 +4,7 @@
@Author : yanyongyu
@Date : 2021-03-16 01:11:47
@LastEditors : yanyongyu
@LastEditTime : 2021-03-31 23:14:18
@LastEditTime : 2021-08-04 13:40:33
@Description : None
@GitHub : https://github.com/yanyongyu
"""
@ -16,7 +16,7 @@ from fastapi import FastAPI, Body
# from ..libs.hook import get_repo_hook
app: FastAPI = nonebot.get_driver().server_app
app: FastAPI = nonebot.get_app()
@app.post("/api/github/hook/{hook_id}")

View File

@ -4,7 +4,7 @@
@Author : yanyongyu
@Date : 2021-03-09 16:45:25
@LastEditors : yanyongyu
@LastEditTime : 2021-06-15 22:20:20
@LastEditTime : 2021-08-04 13:41:12
@Description : None
@GitHub : https://github.com/yanyongyu
"""
@ -13,8 +13,6 @@ __author__ = "yanyongyu"
from datetime import timedelta
from typing import Dict, Optional
from nonebot import require
from src.libs import html2img
from src.libs.github import Github
from ... import github_config as config
@ -22,7 +20,7 @@ from src.libs.github.models import Issue
from src.libs.playwright import get_new_page
from .render import issue_to_html, pr_diff_to_html
cache = require("redis_provider").cache
from src.plugins.redis_provider import cache
async def get_issue(owner: str,