Any ability to capture @someone and store it into a variable?
Any ability to capture @someone and store it into a variable?
From your use of underscores, I assume you're using the Python BDK.
You can use the slash command decorator and include an @mention as an argument in your pattern.
https://symphony-bdk-python.finos.org/markdown/activity-api.html#slash-command-pattern-format
For example,
```python
@activities.slash("/ping {@person}")
async def on_echo_mention(context: CommandContext):
person = context.arguments.get_mention("person")
name = person.user_display_name
uid = person.user_id
await bdk.messages().send_message(context.stream_id, f"Hello <mention uid=\"{uid}\" />")
```
There's no need to do any validation since an @mention will always resolve to an actual user. However, this could be either an internal or external user - so be wary of using the user id immediately to create a new IM and send a message if your bot isn't connected to the external user.
From your use of underscores, I assume you're using the Python BDK.
You can use the slash command decorator and include an @mention as an argument in your pattern.
https://symphony-bdk-python.finos.org/markdown/activity-api.html#slash-command-pattern-format
For example,
```python
@activities.slash("/ping {@person}")
async def on_echo_mention(context: CommandContext):
person = context.arguments.get_mention("person")
name = person.user_display_name
uid = person.user_id
await bdk.messages().send_message(context.stream_id, f"Hello <mention uid=\"{uid}\" />")
```
Any ability to capture @someone and store it into a variable?
Any ability to capture @someone and store it into a variable?
From your use of underscores, I assume you're using the Python BDK.
You can use the slash command decorator and include an @mention as an argument in your pattern.
https://symphony-bdk-python.finos.org/markdown/activity-api.html#slash-command-pattern-format
For example,
```python
@activities.slash("/ping {@person}")
async def on_echo_mention(context: CommandContext):
person = context.arguments.get_mention("person")
name = person.user_display_name
uid = person.user_id
await bdk.messages().send_message(context.stream_id, f"Hello <mention uid=\"{uid}\" />")
```
From your use of underscores, I assume you're using the Python BDK.
You can use the slash command decorator and include an @mention as an argument in your pattern.
https://symphony-bdk-python.finos.org/markdown/activity-api.html#slash-command-pattern-format
For example,
```python
@activities.slash("/ping {@person}")
async def on_echo_mention(context: CommandContext):
person = context.arguments.get_mention("person")
name = person.user_display_name
uid = person.user_id
await bdk.messages().send_message(context.stream_id, f"Hello <mention uid=\"{uid}\" />")
```
Any ability to capture @someone and store it into a variable?
From your use of underscores, I assume you're using the Python BDK.
You can use the slash command decorator and include an @mention as an argument in your pattern.
https://symphony-bdk-python.finos.org/markdown/activity-api.html#slash-command-pattern-format
For example,
```python
@activities.slash("/ping {@person}")
async def on_echo_mention(context: CommandContext):
person = context.arguments.get_mention("person")
name = person.user_display_name
uid = person.user_id
await bdk.messages().send_message(context.stream_id, f"Hello <mention uid=\"{uid}\" />")
```