Skip to content

Commit c7983e6

Browse files
authored
🐛 fix as user config missing bug
1 parent 2e7d69e commit c7983e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nonebot/adapters/github/bot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ async def as_web_user(
182182
async def as_user(self, token: str) -> AsyncGenerator[Self, None]:
183183
if self._ctx_github is not None:
184184
raise RuntimeError("Can not enter context twice.")
185-
self._ctx_github = GitHub(TokenAuthStrategy(token))
185+
self._ctx_github = self._github.with_auth(TokenAuthStrategy(token))
186186
async with self._ctx_github:
187187
try:
188188
yield self
@@ -267,7 +267,7 @@ async def as_web_user(
267267
async def as_user(self, token: str) -> AsyncGenerator[Self, None]:
268268
if self._ctx_github is not None:
269269
raise RuntimeError("Can not enter context twice.")
270-
self._ctx_github = GitHub(TokenAuthStrategy(token))
270+
self._ctx_github = self._github.with_auth(TokenAuthStrategy(token))
271271
async with self._ctx_github:
272272
try:
273273
yield self

0 commit comments

Comments
 (0)