LogoAntiRaid

@antiraid-ext/utils/discordpermcalc

API reference for @antiraid-ext/utils/discordpermcalc

@antiraid-ext/utils/discordpermcalc

Functions

BasePermissions

Computes the 'base permissions' of a member

As this uses a different algorithm from the Rust layer, the permissions returned may be different if there are bugs

Function Signature
--- Computes the 'base permissions' of a member
--- @param g The guild object
--- @param m The member object
--- @return number The base permissions of the member
---
--- As this uses a different algorithm from the Rust layer, the permissions returned may be different if there are bugs
function BasePermissions(g: apitypes.GuildObject, m: apitypes.GuildMemberObject) -> typesext.U64 end

Arguments

g

The guild object

apitypes.GuildObject

m

The member object

apitypes.GuildMemberObject

Returns

number

The base permissions of the member

typesext.U64

ComputeMemberChannelOverwrites

Computes the permissions of a member in a channel

Function Signature
--- Computes the permissions of a member in a channel
--- @param basePerms The base permissions of the member
--- @param g The guild object
--- @param m The member object
--- @param c The channel object
--- @return typesext.U64 The permissions of the member in the channel
function ComputeMemberChannelOverwrites(basePerms: typesext.U64, g: apitypes.GuildObject, m: apitypes.GuildMemberObject, c: apitypes.ChannelObject) -> typesext.U64 end

Arguments

basePerms

The base permissions of the member

typesext.U64

g

The guild object

apitypes.GuildObject

m

The member object

apitypes.GuildMemberObject

c

The channel object

apitypes.ChannelObject

Returns

typesext.U64

The permissions of the member in the channel

typesext.U64

MemberChannelPerms

Function Signature
function MemberChannelPerms(g: apitypes.GuildObject, m: apitypes.GuildMemberObject, c: apitypes.ChannelObject) -> typesext.U64 end

Arguments

g

apitypes.GuildObject

m

apitypes.GuildMemberObject

c

apitypes.ChannelObject

Returns

ret1

typesext.U64

HasPermission

Check if a permission u64 has a permission

Function Signature
--- Check if a permission u64 has a permission
--- @param perms typesext.U64 The permission u64 to check
--- @param perm typesext.U64Convertibles The permission to check for
--- @return boolean True if the permission is present, false otherwise
function HasPermission(perms: typesext.U64, perm: typesext.U64Convertibles) -> boolean end

Arguments

perms

typesext.U64 The permission u64 to check

typesext.U64

perm

typesext.U64Convertibles The permission to check for

typesext.U64Convertibles

Returns

boolean

True if the permission is present, false otherwise

boolean

HasAllPermissions

Check if a permission u64 has all permissions in a set

Function Signature
--- Check if a permission u64 has all permissions in a set
--- @param perms typesext.U64 The permission u64 to check
--- @param permSet set.Set<typesext.U64Convertibles> The set of permissions to check for
--- @return boolean True if all permissions are present, false otherwise
function HasAllPermissions(perms: typesext.U64, permSet: set.Set<typesext.U64Convertibles>) -> boolean end

Arguments

perms

typesext.U64 The permission u64 to check

typesext.U64

permSet

set.Set<typesext.U64Convertibles> The set of permissions to check for

set.Set<typesext.U64Convertibles>

Returns

boolean

True if all permissions are present, false otherwise

boolean

Last updated on