Skip to content

Commit

Permalink
Removed send_file implementation, fun string value
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Gallew committed Mar 13, 2021
1 parent 0be3c47 commit 26394c1
Showing 1 changed file with 2 additions and 25 deletions.
27 changes: 2 additions & 25 deletions will/backends/io_adapters/slack.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,29 +201,6 @@ def set_topic(self, event):
channel=data["channel"],
)

def send_file(self, event):
'Sometimes you need to upload an image or file'

try:
logging.info('EVENT: %s', str(event))
data = {
'filename': event.filename,
'filetype': event.filetype
}
self.set_data_channel_and_thread(event, data)
# This is just *silly*
if 'thread_ts' in data:
del data['thread_ts']
data['channels'] = data['channel']
del data['channel']

logging.debug('calling files_uploads with: %s', data)
result = self.client._web_client.api_call( # pylint: disable=protected-access
'files.upload', files={'file': event.file}, params=data)
logging.debug('send_file result: %s', result)
except Exception:
logging.exception("Error in send_file handling %s", event)

def handle_outgoing_event(self, event, retry=5):
"Process an outgoing event"
try:
Expand Down Expand Up @@ -631,10 +608,10 @@ def _update_people(self, client=None):
user_timezone = member.get("tz")
people[member_id] = Person(
id=member_id,
mention_handle=member.get("mention_handle", "SECRETAGENTMAN"),
mention_handle=member.get("mention_handle", ""),
handle=member["name"],
source=clean_for_pickling(member),
name=member.get("real_name", "SECRETAGENTMAN"),
name=member.get("real_name", ""),
)
if member["name"] == self.handle:
self.me = people[member_id]
Expand Down

0 comments on commit 26394c1

Please sign in to comment.