LogoAntiRaid

@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

discord.GuildObject

set_member_roles

{discord.Snowflake}

Returns

ret1

set.Set<discord.Snowflake>

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

{handle.LockdownSharableData}

Returns

ret1

handle.LockdownSharableData

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

{mode.Lockdown}

state

T

f

Function Signature
f: (handle.LockdownSharableData, T) -> U?

Arguments

arg1

handle.LockdownSharableData

arg2

T

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

{mode.Lockdown}

role_id

discord.Snowflake

Returns

ret1

string?

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

{mode.Lockdown}

channel_id

discord.Snowflake

Returns

ret1

{discord.OverwriteObject}?

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

mode.BaseLockdownModeData

role

discord.GuildRoleObject

hint_idx

This field is optional and may not be specified

number?

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

mode.BaseLockdownModeData

channel

discord.ChannelObject

hint_idx

This field is optional and may not be specified

number?

Last updated on