Skip to content

Commit

Permalink
SlackRTM: Fix file download log string formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Terrance committed Mar 11, 2019
1 parent 059ff8c commit 2992da2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions hangupsbot/plugins/_chatbridge/chatbridge_slackrtm/bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,8 @@ def _relay_msg_image(self, msg, conv_id):
mime_type = resp.content_type
mime_exts = mimetypes.guess_all_extensions(mime_type)
if name_ext.lower() not in [ext.lower() for ext in mime_exts]:
raise ValueError("MIME '{}' does not match extension '{}', we probably didn't get the right file." +
" Attempt [{}/3]"
.format(mime_type, name_ext, retry_count+1))
raise ValueError(("MIME '{}' does not match extension '{}', we probably didn't get the right file."
" [Attempt {}/3]").format(mime_type, name_ext, retry_count + 1))
image = yield from resp.read()
image_id = yield from self.bot._client.upload_image(BytesIO(image), filename=filename)
yield from self._relay_msg(msg, conv_id, image_id)
Expand Down

0 comments on commit 2992da2

Please sign in to comment.