Closed TheJokersThief closed 2 years ago
Could you show an example of code of how this change is supposed to be used?
It's the same principle as send_message
, so they're not dissimilar :)
If the message it received was part of a thread, it will respond in a thread.
@botcmd
def hello(self, msg, args):
"""Say hello to someone"""
return_msg = Card(
to=msg.frm,
title="Hello, world",
parent=msg.parent if msg.parent else None,
)
self._bot.send_card(return_msg)
Or if you wanted to default to sending a threaded message, you could make the parent the received message:
@botcmd
def hello(self, msg, args):
"""Say hello to someone"""
return_msg = Card(
to=msg.frm,
title="Hello, world",
parent=msg
)
self._bot.send_card(return_msg)
``
Thank you for the contribution.
What
send_card
method to include the thread timestamp when providedWhy
Cards can be pretty big, it's nice to keep them limited to threads when appropriate.
Example Usage
If the message it received was part of a thread, it will respond in a thread.
Or if you wanted to default to sending a threaded message, you could make the parent the received message: