Help with mapping scenes for telegram bot

Hi all! I’m trying to set up a telegram integration to select scenes for different rooms.
Returning the list of scenes does not go super smoothly yet.
I want them in an inline keyboard, so they will each need to be structured like Friendly Name:/apply_scene scene_id

I can manage to either prefix them with the command:

{{
   scenes
   | map('regex_replace', '^' , '/apply_scene ')
   | list
}}

Replace the id’s with the friendly name:

{{
  scenes
  | map('state_attr', 'friendly_name')
  | list
}}

Or duplicate the id:

{{
  scenes
  | map('regex_replace', '(.*)', '\\1 \\1')
  | list
}}

But I haven’t found a way to have both. Any tips?
Doing this with a loop gives weird results, the telegram add-on does better with lists.

Thanks!

I don’t understand why you’d want this in a messaging app, but here you go:

{{ zip(scenes | map('state_attr', 'friendly_name') | list, scenes) | map('join', ':/apply_scene ') | list }}

(Unclear from your description and first code example whether the : should be there or not…)