|
16 | 16 |
|
17 | 17 | logging.basicConfig(level=logging.DEBUG) |
18 | 18 |
|
| 19 | + |
19 | 20 | def success(args: SuccessArgs) -> BoltResponse: |
20 | 21 | return BoltResponse(status=200, body="Thanks!") |
21 | 22 |
|
| 23 | + |
22 | 24 | def failure(args: FailureArgs) -> BoltResponse: |
23 | 25 | return BoltResponse(status=args.suggested_status_code, body=args.reason) |
24 | 26 |
|
| 27 | + |
25 | 28 | app = App( |
26 | 29 | signing_secret=os.environ.get("SLACK_SIGNING_SECRET"), |
27 | 30 | installation_store=FileInstallationStore(), |
28 | 31 | oauth_settings=OAuthSettings( |
29 | 32 | client_id=os.environ.get("SLACK_CLIENT_ID"), |
30 | 33 | client_secret=os.environ.get("SLACK_CLIENT_SECRET"), |
31 | | - scopes=["app_mentions:read","channels:history","im:history","chat:write"], |
| 34 | + scopes=["app_mentions:read", "channels:history", "im:history", "chat:write"], |
32 | 35 | user_scopes=[], |
33 | 36 | redirect_uri=None, |
34 | 37 | install_path="/slack/install", |
35 | 38 | redirect_uri_path="/slack/oauth_redirect", |
36 | 39 | state_store=FileOAuthStateStore(expiration_seconds=600), |
37 | | - callback_options=CallbackOptions( |
38 | | - success=success, |
39 | | - failure=failure |
40 | | - ) |
41 | | - ) |
| 40 | + callback_options=CallbackOptions(success=success, failure=failure), |
| 41 | + ), |
42 | 42 | ) |
43 | 43 |
|
| 44 | + |
44 | 45 | @app.command("/hello-bolt-python") |
45 | 46 | def test_command(body, respond, client, ack, logger): |
46 | 47 | logger.info(body) |
|
0 commit comments