You can allow customization using my method. At the end of the day, it's only a matter of preference. Personnally, I prefer to go as generic as I can, much less of a hassle when refactoring is needed.
Here's how I would do it using a dictionnary (LocalStorage could also be used for persistence) :
[attachment=0:8g4zcn5h][/attachment:8g4zcn5h]
edit: I used triggers in this screenshot, I should have used the "is button index down" version instead, my bad !