Skip to content

[Bug] $hasRole(s) does not work as intended #1997

@Patchshifter

Description

@Patchshifter

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I am trying to do some commands/logic with the $hasRole(s) variable in chat messages, and I am not seeing the correct behavior.

Right now I am testing with my Bot Acccount (uwushifter) who has the role of Moderator.

In the vars popup there is some confusion:
$hasRoles[user, any|all, role, rol2, ...] - Returns true if the user has the specified role. Only valid within $if
If you click other examples, you get:
$hasRole[$user, any, mod, vip] - returns true if $user is a mod OR VIP
$if[$user, all, mod, vip] - Returns true if $user is a mod AND a VIP

Two things here, but these are really documentation/typo issues, both $hasRoles in the main vars entry and the $if[$user, all, mod, vip] in the example do not work at all, they just spit out the text verbatim.

I have tried all of the following:

$hasRole[uwushifter, Moderator]
$hasRole[uwushifter, any, mod]

With every permutation of mod (mod, Moderator, moderator, MODERATER, etc), but it always returns false.

I also made a custom viewer role (test2), added uwushifter to it, and tried again with [uwushifter, any, test2], and it still returns false.

Since the var says "only valid within $if" I also tried to put it in a conditional Effect, to the same result.

I also tried $if[$hasRole[uwushifter, all, mod]], but that gets a syntax error.

Expected Behavior

$hasRole[$user, any|all, role, rol2, ...] should properly return true/false

Steps To Reproduce

Create a chat effect and attempt to use the $hasRole variable

Version

v5.54.3

What operating system are you using Firebot on?

Windows 11

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions