v0.2.0 Latest
Enhancement
Change MCQP Parser
We changed the core MCQP parser to the Pest Parser, It helps us to use the parsing expression grammars (or PEG) to set and identify the MCQP grammar. This new change make the syntax more controllable, for example in version 0.1.0 we must to add an empty line between the section, now we solve this issue and you can work without it. In addition it will be easy to add new syntax or modify it, like adding new config feature.
Remove the Empty Line Between the Sections
We removed the empty line between sections, now you can work without them.
q: question?
option one
option two *
p: Poll
option one
option two
This will parse and checked without any errors.
Improve the Syntax Errors
We added new form of the syntax errors, now you have excellent errors and fix tips, for more information see How to Read MCQP Errors, simple example:
ERROR: The config feature missing the assignment operator.
--> .\test.mcq:3:12
|
3 | counter
| ^ expected an assignment operator, found None.
FIX: Add the assignment operator followed by the value to assign the feature value.
|
3 | counter = <FEATURE-VALUE>
| ++++++++++++++++++
[ERROR] @parser - Can not parse the file!
Add Message Markdown Errors
We added new config featrue to enable the message markdown errors, now you can write the markdown in the message block and the MCQP will parse it using the TeleMark Parser, for example:
// Enable the markdown errors.
config:
md_err = true
// This will throw an error at line 7
m:(
this is invalid *bold
):endm
// Disable the markdown errors.
config:
md_err = false
// This will NOT throw an error.
m:(
this is valid *bold
):endm
Fix
Fix Questions Length After the Counter
In version 0.1.0, when you add a counter to a long question it will throw an error like this
Can not send the question, now we check the length of the question after adding the counter.
Fix Send Questions/Polls With One Option
The Telegram API will return an error if the poll or the question has only one option, in this case we check if the question/poll has less then 2 options we throw an error, for example:
// This will throw an error
p: question
one option only
// This will throw an error
q: question
one option only *
// This will throw an error
mcp: question
one option only