Skip to content
This repository has been archived by the owner on Aug 17, 2023. It is now read-only.

Commit

Permalink
[#225] slackclientのメソッド名変更対応、githubからinstallする時に推奨されない方法でやっていたので修正
Browse files Browse the repository at this point in the history
  • Loading branch information
wanshot committed Sep 2, 2022
1 parent 7a451a3 commit 9100cf5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
3 changes: 1 addition & 2 deletions src/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cachetools==2.0.1
certifi==2017.7.27.1
chardet==3.0.4
geopy==1.11.0
-e git+git@github.com:ebmdatalab/slackbot@develop#egg=slackbot
git+https://git@github.com/ebmdatalab/slackbot@develop#egg=slackbot
idna==2.6
kml2geojson==4.0.2
Mako==1.0.7
Expand All @@ -15,7 +15,6 @@ python-dateutil==2.6.1
python-editor==1.0.3
requests==2.24.0
six==1.11.0
slackbot==1.0.0
slacker==0.14.0
SQLAlchemy==1.3.19
urllib3==1.22
Expand Down
6 changes: 3 additions & 3 deletions src/haro/botmessage.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def webapisend(message, text):
channel = message.channel
channel_id = channel._body['id']
if 'thread_ts' in message.body:
sc.chat.post_message(channel_id, text=text, as_user=True,
unfurl_links=True, thread_ts=message.thread_ts)
sc.chat_postMessage(channel=channel_id, text=text, as_user=True,
unfurl_links=True, thread_ts=message.thread_ts)
else:
sc.chat.post_message(channel_id, text=text, as_user=True, unfurl_links=True)
sc.chat_postMessage(channel=channel_id, text=text, as_user=True, unfurl_links=True)
9 changes: 5 additions & 4 deletions src/haro/plugins/amesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,15 @@ def amesh(message):

# 外部サイトに投稿してURLを貼る方法(S3とか)だとaccesskey設定等いるのでslackに直接アップロード
sc = message._client.webapi
sc.files.upload(
file_=tmpname,

sc.files_upload(
file=tmpname,
initial_comment=comment,
title=name,
filename=name,
channels=message.channel._body["name"],
channels=message._body["channel"],
)
except Exception:
except Exception: # NOQA
logger.exception("amesh exception")
if i == MAX_RETRY_NUM:
botsend(message, "{}回目: だめでした…またためしてね".format(i))
Expand Down
4 changes: 2 additions & 2 deletions src/haro/plugins/redmine.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ def show_ticket_information(message, *ticket_ids): # NOQA: R701, C901
url = "{}{}".format(ticket.url, note_suffix)

sc = message._client.webapi
res = sc.chat.post_message(channel_id, "<{}|{}>".format(url, text), as_user=True)
sc.chat.post_message(channel_id, description, as_user=True, thread_ts=res.body['ts'])
res = sc.chat_postMessage(channel=channel_id, text="<{}|{}>".format(url, text), as_user=True)
sc.chat_postMessage(channel=channel_id, text=description, as_user=True, thread_ts=res.body['ts'])


@respond_to(r'^redmine\s+key\s+(\S+)$')
Expand Down
1 change: 1 addition & 0 deletions src/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ prettytable
cachetools
python-redmine
slackclient
slacker

geopy
kml2geojson
Expand Down

0 comments on commit 9100cf5

Please sign in to comment.