@antiraid-ext/lockdowns/utils
API reference for @antiraid-ext/lockdowns/utils
@antiraid-ext/lockdowns/utils
Functions
getCriticalRoles
Returns the critical roles for a guild
The ``set_member_roles`` here are the pre-defined roles set by the server that should be locked down
If ``set_member_roles`` is empty (no overrides), the @everyone role is returned
Function Signature
--- Returns the critical roles for a guild
---
--- The \`\`set_member_roles\`\` here are the pre-defined roles set by the server that should be locked down
--- If \`\`set_member_roles\`\` is empty (no overrides), the @everyone role is returned
function getCriticalRoles(guild: discord.GuildObject, set_member_roles: {discord.Snowflake}) -> set.Set<discord.Snowflake> end
Arguments
guild
set_member_roles
Returns
ret1
mergelsd
Merges a set of lockdown sharable data's assuming that least recent lockdowns are first
Function Signature
--- Merges a set of lockdown sharable data's assuming that least recent lockdowns are first
function mergelsd(lsd: {handle.LockdownSharableData}) -> handle.LockdownSharableData end
Arguments
lsd
Returns
ret1
getunderlying
Returns the underlying permissions (or otherwise) for a given state
This works by merging the shareable data from all lockdowns in the order of least recent first,
to ensure that the permissions are derived from the least recent lockdowns first and then using
`f` to extract the desired data from the merged sharable data
Function Signature
--- Returns the underlying permissions (or otherwise) for a given state
---
--- This works by merging the shareable data from all lockdowns in the order of least recent first,
--- to ensure that the permissions are derived from the least recent lockdowns first and then using
--- \`f\` to extract the desired data from the merged sharable data
function getunderlying<T, U>(lockdowns: {mode.Lockdown}, state: T, f: (handle.LockdownSharableData, T) -> U?) -> U? end
Generics
T
This generic is unconstrained and can be any type
U
This generic is unconstrained and can be any type
Arguments
lockdowns
state
f
Function Signature
f: (handle.LockdownSharableData, T) -> U?
Arguments
arg1
arg2
Returns
ret1
U?
Returns
ret1
U?
getunderlyingrolepermissions
Returns the underlying role permissions if any
Function Signature
--- Returns the underlying role permissions if any
function getunderlyingrolepermissions(lockdowns: {mode.Lockdown}, role_id: discord.Snowflake) -> string? end
Arguments
lockdowns
role_id
Returns
ret1
getunderlyingchannelpermissions
Returns the underlying channel permission overwrites if any
Function Signature
--- Returns the underlying channel permission overwrites if any
function getunderlyingchannelpermissions(lockdowns: {mode.Lockdown}, channel_id: discord.Snowflake) -> {discord.OverwriteObject}? end
Arguments
lockdowns
channel_id
Returns
ret1
replacerole
Replaces a role in the guild roles list
Function Signature
--- Replaces a role in the guild roles list
function replacerole(data: mode.BaseLockdownModeData, role: discord.GuildRoleObject, hint_idx: number?) end
Arguments
data
role
hint_idx
This field is optional and may not be specified
replacechannel
Replaces a channel in the guild channel list
Function Signature
--- Replaces a channel in the guild channel list
function replacechannel(data: mode.BaseLockdownModeData, channel: discord.ChannelObject, hint_idx: number?) end
Arguments
data
channel
hint_idx
This field is optional and may not be specified
Last updated on