Using a function as a permission message throws an invalid warning
MinecraftMan1013number2 opened this issue ยท 8 comments
Skript/Server Version
> skript info
[15:40:03 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[15:40:03 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[15:40:03 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[15:40:03 INFO]: [Skript] Server Version: git-Paper-496 (MC: 1.20.4)
[15:40:03 INFO]: [Skript] Skript Version: 2.9.0 (skriptlang-github)
[15:40:03 INFO]: [Skript] Installed Skript Addons:
[15:40:03 INFO]: [Skript] - Skent v3.3.0
[15:40:03 INFO]: [Skript] - skript-yaml v1.5
[15:40:03 INFO]: [Skript] - skript-reflect v2.4 (https://github.com/SkriptLang/skript-reflect)
[15:40:03 INFO]: [Skript] Installed dependencies:
[15:40:03 INFO]: [Skript] - Vault v1.7.3-b131
Bug Description
When you use a function as a permission message, it throws an incorrect warning.
Expected Behavior
No warning is thrown while reloading since it is all valid
Steps to Reproduce
The code that I am using is as follows:
command /mycommand:
permission: my.permission
permission message: %getPermissionMessage()%
trigger:
send "Command executed!"
function getPermissionMessage() :: text:
return "&4No permission!"
Errors or Screenshots
With %% around the function on the permission message, this is the output
Without it, this is the output
Other
While I understand that this is a very small bug, its still kind of annoying (especially when the warning pops up a ton since I'm using a function for a bunch of commands).
For anyone also having this issue, here are two ways to avoid it:
- Put &r in front of your permission message (so like
permission message: &r%function()%
- Disable the warning in the config
Agreement
- I have read the guidelines above and affirm I am following them with this report.
It's a perfectly valid warning, as what's happening is the same as doing "%function()%"
, but since the user has no control over the " in this situation, disabling the warning would be a slight enhancement.
The only way to get it to work is with the %%, so shouldn't there be no error?
The only way to get it to work is with the %%, so shouldn't there be no error?
That's why I said the user has no control over the ". The warning is doing exactly what it's meant to do, but since the user can't actually follow its directions due to how the input is set up, it'd be an enhancement to turn it off.
You may be able to use permission message: "%getPermissionMessage()%"
for the moment