LogoAntiRaid

@antiraid-ext/utils/rolecmp

API reference for @antiraid-ext/utils/rolecmp

@antiraid-ext/utils/rolecmp

Functions

IsRoleALessThanRoleB

Returns if A is lower than B in hierarchy order.

Function Signature
--- Returns if A is lower than B in hierarchy order.
---
--- @param a discord.GuildRoleObject Role A
--- @param b discord.GuildRoleObject Role B
--- @return boolean \`\`true\`\` if A is lower than B in hierarchy order, \`\`false\`\` otherwise.
function IsRoleALessThanRoleB(a: discord.GuildRoleObject, b: discord.GuildRoleObject) -> boolean end

Arguments

a

discord.GuildRoleObject Role A

discord.GuildRoleObject

b

discord.GuildRoleObject Role B

discord.GuildRoleObject

Returns

boolean

``true`` if A is lower than B in hierarchy order, ``false`` otherwise.

boolean

IsRoleALessThanOrEqualToRoleB

Returns if A is less than or equal to B in hierarchy order.

Function Signature
--- Returns if A is less than or equal to B in hierarchy order.
---
--- @param a discord.GuildRoleObject Role A
--- @param b discord.GuildRoleObject Role B
--- @return boolean \`\`true\`\` if A is lower than or equal to B in hierarchy order, \`\`false\`\` otherwise.
function IsRoleALessThanOrEqualToRoleB(a: discord.GuildRoleObject, b: discord.GuildRoleObject) -> boolean end

Arguments

a

discord.GuildRoleObject Role A

discord.GuildRoleObject

b

discord.GuildRoleObject Role B

discord.GuildRoleObject

Returns

boolean

``true`` if A is lower than or equal to B in hierarchy order, ``false`` otherwise.

boolean

IsRoleAGreaterThanRoleB

Returns if A is greater than B in hierarchy order.

Function Signature
--- Returns if A is greater than B in hierarchy order.
---
--- @param a discord.GuildRoleObject Role A
--- @param b discord.GuildRoleObject Role B
--- @return boolean \`\`true\`\` if A is greater than or equal to B in hierarchy order, \`\`false\`\` otherwise.
function IsRoleAGreaterThanRoleB(a: discord.GuildRoleObject, b: discord.GuildRoleObject) -> boolean end

Arguments

a

discord.GuildRoleObject Role A

discord.GuildRoleObject

b

discord.GuildRoleObject Role B

discord.GuildRoleObject

Returns

boolean

``true`` if A is greater than or equal to B in hierarchy order, ``false`` otherwise.

boolean

IsRoleAGreaterThanOrEqualToRoleB

Returns if Role A is greater than or equal to Role B in hierarchy order.

Function Signature
--- Returns if Role A is greater than or equal to Role B in hierarchy order.
---
--- @param a discord.GuildRoleObject Role A
--- @param b discord.GuildRoleObject Role B
--- @return boolean \`\`true\`\` if A is greater than or equal to B in hierarchy order, \`\`false\`\` otherwise.
function IsRoleAGreaterThanOrEqualToRoleB(a: discord.GuildRoleObject, b: discord.GuildRoleObject) -> boolean end

Arguments

a

discord.GuildRoleObject Role A

discord.GuildRoleObject

b

discord.GuildRoleObject Role B

discord.GuildRoleObject

Returns

boolean

``true`` if A is greater than or equal to B in hierarchy order, ``false`` otherwise.

boolean

SortRolesByHierarchyAsc

Sorts roles by hierarchy order in ascending order [lower roles first].

Function Signature
--- Sorts roles by hierarchy order in ascending order [lower roles first].
function SortRolesByHierarchyAsc(roles: {discord.GuildRoleObject}) -> {discord.GuildRoleObject} end

Arguments

roles

{discord.GuildRoleObject}

Returns

ret1

{discord.GuildRoleObject}

SortRolesByHierarchyDesc

Sorts roles by hierarchy order in descending order [roles higher in hierarchy first].

Function Signature
--- Sorts roles by hierarchy order in descending order [roles higher in hierarchy first].
function SortRolesByHierarchyDesc(roles: {discord.GuildRoleObject}) -> {discord.GuildRoleObject} end

Arguments

roles

{discord.GuildRoleObject}

Returns

ret1

{discord.GuildRoleObject}

Last updated on