-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.py
25 lines (20 loc) · 818 Bytes
/
bot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from slack_bolt.adapter.socket_mode.aiohttp import AsyncSocketModeHandler
from slack_bolt.app.async_app import AsyncApp
from slack_bolt.oauth.async_oauth_flow import AsyncOAuthFlow
from api.google_api import GoogleService
from data.config import SLACK_CONFIG, SLACK_SCOPES
from utils.logging import slack_logging
app = AsyncApp(
signing_secret=SLACK_CONFIG['signing_secret'],
oauth_flow=AsyncOAuthFlow.sqlite3(
database='._.db',
client_id=SLACK_CONFIG['client_id'],
client_secret=SLACK_CONFIG['client_secret'],
scopes=SLACK_SCOPES['bot_scopes'],
user_scopes=SLACK_SCOPES['user_scopes']
)
)
google_service = GoogleService()
async def start_bot():
slack_logging.info('Start bot')
await AsyncSocketModeHandler(app, SLACK_CONFIG['app_token']).start_async()