Discord4Fabric
Discord4Fabric copied to clipboard
[Bug]?? grant_role seems to always throw an error ?
as title.. the grant_role action
always seems to throw fault, showing a Invalid grant_role value format (should be object)
in log .. ?
which i can see you have coded that error in for a reason .. ?
if (!(value instanceof JsonObject jsonObject)) {
Discord4Fabric.LOGGER.error("Invalid grant_role value format (should be object)");
return;
}
what would be something to look for to fix this issue ?
this mod is Soo versatile ...
Also having this issue, any luck?
Totally forgot about this, can you send me your grant_role value in your custom events config? From the error, it seems that you've put something in the value other than an object; it's supposed to be in this format:
"value": {
"user": "user id to grant to role to",
"role": "role id"
}
Sure! { "id": "grant_role", "value": "1061971471485902979" }
On Mon, Jan 9, 2023, 5:00 a.m. Reimnop @.***> wrote:
Totally forgot about this, can you send me your grant_role value in your custom events config?
— Reply to this email directly, view it on GitHub https://github.com/Reimnop/Discord4Fabric/issues/63#issuecomment-1375588943, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZXFO636I7W6NWCF2BWS5JDWRQDWVANCNFSM6AAAAAASREVAB4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>
That is definitely the incorrect way to do it; the correct way would be like this:
{
"id":"grant_role",
"value": {
"user":"%linked_account:id%",
"role":"1061971471485902979"
}
}
Don't forget to also add the linked_account
constraint by doing this:
"requires": [
"linked_account"
]
Oohhh, I see. Thanks for clarifying, my bad.
On Mon, Jan 9, 2023, 5:15 a.m. Reimnop @.***> wrote:
That is definitely the incorrect way to do it; the correct way would be like this:
{ "id":"grant_role", "value": { "user":"%linked_account:id%, "role":"1061971471485902979" } }
Don't forget to also add the linked_account constraint by doing this:
"requires": [ "linked_account" ]```
— Reply to this email directly, view it on GitHub https://github.com/Reimnop/Discord4Fabric/issues/63#issuecomment-1375610927, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZXFO65ED6TABMBYO2SOFL3WRQFQBANCNFSM6AAAAAASREVAB4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>
You're welcome, apologies for the very late reply