examples-python-api: Fix `message_id` type.

The `message_id` was made an `str` object because
the request expected `Dict[str, str]`. The request is now
casted to `Dict[str, Any]` to fix the issue and removed
typecast of `message_id` to str.

python-zulip-api reference:
https://github.com/zulip/python-zulip-api/pull/653
This commit is contained in:
LoopThrough-i-j 2021-02-23 20:02:15 +05:30 committed by Tim Abbott
parent 1a241cef88
commit d1ee2d31c7
1 changed files with 4 additions and 2 deletions

View File

@ -783,10 +783,11 @@ def send_message(client: Client) -> int:
@openapi_test_function("/messages/{message_id}/reactions:post")
def add_reaction(client: Client, message_id: int) -> None:
request: Dict[str, Any] = {}
# {code_example|start}
# Add an emoji reaction
request = {
"message_id": str(message_id),
"message_id": message_id,
"emoji_name": "octopus",
}
@ -797,10 +798,11 @@ def add_reaction(client: Client, message_id: int) -> None:
@openapi_test_function("/messages/{message_id}/reactions:delete")
def remove_reaction(client: Client, message_id: int) -> None:
request: Dict[str, Any] = {}
# {code_example|start}
# Remove an emoji reaction
request = {
"message_id": str(message_id),
"message_id": message_id,
"emoji_name": "octopus",
}