@@ -45,7 +45,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
45
45
< span > Expand source code</ span >
46
46
</ summary >
47
47
< pre > < code class ="python "> class BaseSlackRequestHandler:
48
- app: App # type: ignore
48
+ app: Union[ App, "AsyncApp"] # type: ignore[name-defined]
49
49
path: str
50
50
51
51
async def dispatch(self, request: AsgiHttpRequest) -> BoltResponse:
@@ -68,13 +68,13 @@ <h2 class="section-title" id="header-classes">Classes</h2>
68
68
return AsgiHttpResponse(
69
69
status=bolt_response.status, headers=bolt_response.headers, body=bolt_response.body
70
70
)
71
- if path == self.app.oauth_flow.redirect_uri_path:
72
- bolt_response: BoltResponse = await self.handle_callback(request)
71
+ elif path == self.app.oauth_flow.redirect_uri_path:
72
+ bolt_response = await self.handle_callback(request)
73
73
return AsgiHttpResponse(
74
74
status=bolt_response.status, headers=bolt_response.headers, body=bolt_response.body
75
75
)
76
76
if method == "POST" and path == self.path:
77
- bolt_response: BoltResponse = await self.dispatch(request)
77
+ bolt_response = await self.dispatch(request)
78
78
return AsgiHttpResponse(status=bolt_response.status, headers=bolt_response.headers, body=bolt_response.body)
79
79
return AsgiHttpResponse(status=404, headers={"content-type": ["text/plain;charset=utf-8"]}, body="Not Found")
80
80
@@ -91,23 +91,23 @@ <h2 class="section-title" id="header-classes">Classes</h2>
91
91
async def __call__(self, scope: scope_type, receive: Callable, send: Callable) -> None:
92
92
if scope["type"] == "http":
93
93
response: AsgiHttpResponse = await self._get_http_response(
94
- scope["method"], scope["path"], AsgiHttpRequest(scope, receive)
94
+ method= scope["method"], path= scope["path"], request= AsgiHttpRequest(scope, receive) # type: ignore[arg-type]
95
95
)
96
96
await send(response.get_response_start())
97
97
await send(response.get_response_body())
98
98
return
99
99
if scope["type"] == "lifespan":
100
100
await send(await self._handle_lifespan(receive))
101
101
return
102
- raise TypeError(f"Unsupported scope type: {scope['type']}")</ code > </ pre >
102
+ raise TypeError(f"Unsupported scope type: {scope['type']!r }")</ code > </ pre >
103
103
</ details >
104
104
< h3 > Subclasses</ h3 >
105
105
< ul class ="hlist ">
106
106
< li > < a title ="slack_bolt.adapter.asgi.builtin.SlackRequestHandler " href ="builtin/index.html#slack_bolt.adapter.asgi.builtin.SlackRequestHandler "> SlackRequestHandler</ a > </ li >
107
107
</ ul >
108
108
< h3 > Class variables</ h3 >
109
109
< dl >
110
- < dt id ="slack_bolt.adapter.asgi.base_handler.BaseSlackRequestHandler.app "> < code class ="name "> var < span class ="ident "> app</ span > : < a title ="slack_bolt.app.app.App " href ="../../app/app.html#slack_bolt.app.app.App "> App</ a > </ code > </ dt >
110
+ < dt id ="slack_bolt.adapter.asgi.base_handler.BaseSlackRequestHandler.app "> < code class ="name "> var < span class ="ident "> app</ span > : Union[ < a title ="slack_bolt.app.app.App " href ="../../app/app.html#slack_bolt.app.app.App "> App</ a > , AsyncApp] </ code > </ dt >
111
111
< dd >
112
112
< div class ="desc "> </ div >
113
113
</ dd >
0 commit comments