Skip to content

Commit

Permalink
EditedMessage should use 'username' as 'user' is not present in slack…
Browse files Browse the repository at this point in the history
… API response (#2021)

* EditedMessage should use 'username' as 'user' is not present in slack API response

* We will keep the existing user but will also try username if it fails

---------

Co-authored-by: Rodrigo Albuquerque <ralbuquerque@apple.com>
Co-authored-by: Jacob Tomlinson <jacob@tomlinson.email>
  • Loading branch information
3 people committed Apr 25, 2024
1 parent 28820d3 commit 15fdf47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion opsdroid/connector/slack/create_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ async def edit_message(self, event, channel):
return events.EditedMessage(
text,
user=user_name,
user_id=event["message"]["user"],
user_id=event["message"].get("user", event["message"]["username"]),
target=event["channel"],
connector=self.connector,
event_id=event["ts"],
Expand Down

0 comments on commit 15fdf47

Please sign in to comment.