LogoAntiRaid

@antiraid-ext/lockdowns/handle

API reference for @antiraid-ext/lockdowns/handle

@antiraid-ext/lockdowns/handle

Types

LockdownModeHandle

To ensure two lockdowns don't conflict with each other, we need some information about what all lockdowns are handling

along with what specificity they have

Raw Type
--- To ensure two lockdowns don't conflict with each other, we need some information about what all lockdowns are handling
--- along with what specificity they have
type LockdownModeHandle = {
	roles: set.Set<discord.Snowflake>,

	channels: set.Set<discord.Snowflake>
}
PropTypeDescription
roles
-
channels
-

LockdownModeHandles

To ensure two lockdowns don't conflict with each other, we need some information about what all lockdowns are handling

along with what specificity they have

Raw Type
--- To ensure two lockdowns don't conflict with each other, we need some information about what all lockdowns are handling
--- along with what specificity they have
type LockdownModeHandles = {
	roles: priorityset.PrioritySet<discord.Snowflake>,

	channels: priorityset.PrioritySet<discord.Snowflake>,

	--- Adds a handle to the set given the specificity of the handle
	addhandle: (handle: LockdownModeHandle, specificity: number) -> (),

	--- Removes a handle from the set given the specificity of the handle
	removehandle: (handle: LockdownModeHandle, specificity: number) -> (),

	--- A role is locked if it contains all roles of the current *with a lower specificity*
	isrolelocked: (role: discord.Snowflake, specificity: number) -> boolean,

	--- A channel is locked if it contains all channel of the current *with a lower specificity*
	ischannellocked: (channel: discord.Snowflake, specificity: number) -> boolean,

	--- A handle is redundant if it contains all roles and channels of the current *with a lower specificity*
	isredundant: (other: LockdownModeHandle, other_spec: number) -> boolean
}
PropTypeDescription
addhandle
(handle: LockdownModeHandle, specificity: number) -> ()
Adds a handle to the set given the specificity of the handle
removehandle
(handle: LockdownModeHandle, specificity: number) -> ()
Removes a handle from the set given the specificity of the handle
isrolelocked
(role: discord.Snowflake, specificity: number) -> boolean
A role is locked if it contains all roles of the current *with a lower specificity*
ischannellocked
(channel: discord.Snowflake, specificity: number) -> boolean
A channel is locked if it contains all channel of the current *with a lower specificity*
isredundant
(other: LockdownModeHandle, other_spec: number) -> boolean
A handle is redundant if it contains all roles and channels of the current *with a lower specificity*
roles
-
channels
-

LockdownSharableData

To allow lockdowns to have access to the low-level data of other lockdowns,

this struct contains the roles and channels each lockdown knows about

Raw Type
--- To allow lockdowns to have access to the low-level data of other lockdowns,
--- this struct contains the roles and channels each lockdown knows about
type LockdownSharableData = {
	role_permissions: {
		[discord.Snowflake]: string
	},

	channel_permissions: {
		[discord.Snowflake]: {discord.OverwriteObject}
	}
}
PropTypeDescription
role_permissions
{[discord.Snowflake]: string}
-
channel_permissions
{[discord.Snowflake]: {discord.OverwriteObject}}
-

Functions

LockdownModeHandle

To ensure two lockdowns don't conflict with each other, we need some information about what all lockdowns are handling

along with what specificity they have

Function Signature
--- To ensure two lockdowns don't conflict with each other, we need some information about what all lockdowns are handling
--- along with what specificity they have
function LockdownModeHandle() -> LockdownModeHandle end

Returns

ret1

LockdownModeHandle

LockdownModeHandles

To ensure two lockdowns don't conflict with each other, we need some information about what all lockdowns are handling

along with what specificity they have

Function Signature
--- To ensure two lockdowns don't conflict with each other, we need some information about what all lockdowns are handling
--- along with what specificity they have
function LockdownModeHandles() -> LockdownModeHandles end

Returns

ret1

LockdownModeHandles

Last updated on