Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing KeyErrors on messages without text #1923

Merged
merged 1 commit into from
May 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions opsdroid/connector/telegram/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ async def handle_messages(self, message, user, user_id, update_id):

if message.get("reply_to_message"):
event = Reply(
text=emoji.demojize(message["text"]),
text=emoji.demojize(message.get("text", "")),
user=user,
user_id=user_id,
event_id=message["message_id"],
Expand All @@ -317,7 +317,7 @@ async def handle_messages(self, message, user, user_id, update_id):

if message.get("text"):
event = Message(
text=emoji.demojize(message["text"]),
text=emoji.demojize(message.get("text", "")),
user=user,
user_id=user_id,
target=message["chat"]["id"],
Expand Down