Skip to content

Commit

Permalink
🐛 fix as user config missing bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yanyongyu authored Oct 6, 2022
1 parent 2e7d69e commit c7983e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nonebot/adapters/github/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ async def as_web_user(
async def as_user(self, token: str) -> AsyncGenerator[Self, None]:
if self._ctx_github is not None:
raise RuntimeError("Can not enter context twice.")
self._ctx_github = GitHub(TokenAuthStrategy(token))
self._ctx_github = self._github.with_auth(TokenAuthStrategy(token))
async with self._ctx_github:
try:
yield self
Expand Down Expand Up @@ -267,7 +267,7 @@ async def as_web_user(
async def as_user(self, token: str) -> AsyncGenerator[Self, None]:
if self._ctx_github is not None:
raise RuntimeError("Can not enter context twice.")
self._ctx_github = GitHub(TokenAuthStrategy(token))
self._ctx_github = self._github.with_auth(TokenAuthStrategy(token))
async with self._ctx_github:
try:
yield self
Expand Down

0 comments on commit c7983e6

Please sign in to comment.