Macro Adding By Context Menu & More - 0.2.0
Lot's of changes here!
Context Menu Adding
You can now add a macro by typing out a message and using the message context menu
The message should be formatted as such:
.macroname
@description a short description for the list
macroText
macroText supports markdown formatting, plus some extras.
These include:
!embed at the top to specify it as an embed
!title embedTitle - if it's an embed embedTitle will be set as the title
!footer footerText - if it's an embed footerText will be set as the footer
!color #RRGGBB - if it's an embed to specify the embed colour. If not specified it will be a random colour each time.
{int} - (0 indexed) use this for macro parameters. They are separated by spaces, and the final parameter will take the rest of the macro parameters. Eg. .macro param1 param2 param3 on a macro with only {0} and {1} will put param1 in {0}, and param2 param3 in {1}.
{att(int)} - (0 indexed) to specify where attachment links should be placed. The first image attachment will be set as the embed image if it's an embed. Any attachments without a link placement specified will be put at the bottom of the message.\
Note
In an embed, the image set as embed image is removed from the attachment list! This means if you had an image and other file, the other file will be {att0}, not {att1}
Attachments are just sent along with the message, and allow as many attachments as needed.
Attachments Changes
Attachments are no longer downloaded and reuploaded every macro use. Instead they are downloaded and reuploaded to the specified channel, and a link to the reuploaded one is saved. Macros added by the new context menu are exempt from this however, as links to the Attachments are saved directly without reupload.
Note
This means you CAN NOT delete the message used to create the macro, OR THE ATTACHMENTS WILL BREAK
Guild and Channel for the bot
Instead of keeping the main Guild and Attachments channel IDs hardcoded, they are now specified by LCVR_GUILD and LCVR_ATT_CHANNEL environment variables respectively
Warning
Due to the change for embed colour to be specified by !color, and how attachments are saved, you will need to manually edit the SETTINGS.json file in appdata to keep macros