Unanswered
Here is a full example which may help also referenced from the same page shared previously.
from symphony.bdk.core.activity.command import CommandContext
from symphony.bdk.core.config.loader import BdkConfigLoader
from symphony.bdk.core.symphony_bdk import SymphonyBdk
async def run():
async with SymphonyBdk(BdkConfigLoader.load_from_symphony_dir("config.yaml")) as bdk:
activities = bdk.activities()
messages = bdk.messages()
@activities.slash("/buy {$ticker} {quantity}")
async def on_echo_mention(context: CommandContext):
ticker = context.arguments.get_cashtag("ticker").value # can also be retrieved with context.arguments.get("ticker").value
quantity = context.arguments.get_string("quantity")
message = f"Buy ticker {ticker} with quantity {quantity}"
await messages.send_message(context.stream_id, f"<messageML>{message}</messageML>")
4K Views
0
Answers
2 years ago
2 years ago
May I ask a follow-up question?
If the case is:
Person A has said
/buy {$ticker} {quantity}
1 minute ago and 1 hour ago respectively, and I want to open this bot to execute only the command for the request 1 minute ago (since I have executed the command for the 1 hour ago request already), can this be done?Thank you