@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
m
The member object
Returns
number
The base permissions of the member
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
g
The guild object
m
The member object
c
The channel object
Returns
typesext.U64
The permissions of the member in the channel
MemberChannelPerms
Function Signature
function MemberChannelPerms(g: apitypes.GuildObject, m: apitypes.GuildMemberObject, c: apitypes.ChannelObject) -> typesext.U64 end
Arguments
g
m
c
Returns
ret1
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
perm
typesext.U64Convertibles The permission to check for
Returns
boolean
True if the permission is present, false otherwise
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
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
Last updated on