File tree Expand file tree Collapse file tree 4 files changed +6
-8
lines changed Expand file tree Collapse file tree 4 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ Model reused from [Moderator AI](https://github.com/aio-libs/aiohttp-demos/tree/
10
10
11
11
## Requirements
12
12
- [ aiohttp] ( https://github.com/aio-libs/aiohttp )
13
- - [ aioslacker ] ( https://github.com/aio-libs/aioslacker )
13
+ - [ slack_sdk ] ( https://github.com/slackapi/python-slack-sdk )
14
14
15
15
16
16
## Prerequisites
Original file line number Diff line number Diff line change @@ -36,8 +36,8 @@ async def _respond(self, event):
36
36
text = (f"Hey <@{ event ['user' ]} >, please be polite! "
37
37
f"Here is a funny cat GIF for you { image_url } " )
38
38
39
- await self .slack_client .chat . post_message (
40
- event ["channel" ],
39
+ await self .slack_client .chat_postMessage (
40
+ channel = event ["channel" ],
41
41
text = text ,
42
42
)
43
43
Original file line number Diff line number Diff line change 4
4
from pathlib import Path
5
5
6
6
from aiohttp import web
7
- from aioslacker import Slacker
7
+ from slack_sdk . web . async_client import AsyncWebClient
8
8
9
9
from .giphy import GiphyClient
10
10
from .handlers import MainHandler
@@ -38,7 +38,7 @@ async def init_application(config):
38
38
39
39
executor = ProcessPoolExecutor (MAX_WORKERS )
40
40
41
- slack_client = Slacker (SLACK_BOT_TOKEN )
41
+ slack_client = AsyncWebClient (SLACK_BOT_TOKEN )
42
42
giphy_client = GiphyClient (GIPHY_API_KEY , config ["request_timeout" ])
43
43
44
44
handler = MainHandler (executor , slack_client , giphy_client )
@@ -55,7 +55,6 @@ async def init_application(config):
55
55
56
56
app .on_cleanup .append (setup_cleanup_hooks ([
57
57
partial (executor .shutdown , wait = True ),
58
- slack_client .close ,
59
58
giphy_client .close ,
60
59
]))
61
60
Original file line number Diff line number Diff line change 1
1
-i https://pypi.org/simple/
2
2
aiohttp == 3.11.7
3
- aioslacker == 0.0.11
4
3
async-timeout == 5.0.1
5
4
atomicwrites == 1.4.1
6
5
attrs == 24.2.0
@@ -19,7 +18,7 @@ pyyaml==6.0.2
19
18
scikit-learn == 1.5.2
20
19
scipy == 1.13.1
21
20
six == 1.16.0
22
- slacker == 0.9.42
21
+ slack_sdk == 3.33.4
23
22
urllib3 == 2.2.3
24
23
yarl == 1.18.0
25
24
zipp == 3.21.0
You can’t perform that action at this time.
0 commit comments