LogoAntiRaid

@antiraid-ext/lockdowns/mode

API reference for @antiraid-ext/lockdowns/mode

@antiraid-ext/lockdowns/mode

Types

Lockdown

Raw Type
type Lockdown = {
	id: string,

	reason: string,

	type: LockdownMode,

	data: any,

	-- Data specific to the lockdown mode
	created_at: datetime.DateTime
}
PropTypeDescription
id
-
reason
-
type
-
data
-
created_at
-

BaseLockdownModeData

Base lockdown mode data

Raw Type
--- Base lockdown mode data
type BaseLockdownModeData = {
	guild: discord.GuildObject,

	channels: {discord.ChannelObject},

	critical_roles: set.Set<discord.Snowflake>,

	lockdowns: {Lockdown},

	ctx: Primitives.TemplateContext
}
PropTypeDescription
guild
-
channels
-
critical_roles
-
lockdowns
-
ctx
-

ExtLockdownModeData

Extended lockdown mode data

Raw Type
--- Extended lockdown mode data
type ExtLockdownModeData = BaseLockdownModeData & {
	all_handles: handle.LockdownModeHandles,

	lockdown: Lockdown
}

Intersection with variants:

Variant 1

BaseLockdownModeData

Variant 2
PropTypeDescription
all_handles
-
lockdown
-

LockdownMode

Raw Type
type LockdownMode = {
	--- Returns the string form of the lockdown mode
	string_form: () -> string,

	--- The specificity of the lockdown mode. More specific lockdowns should have higher specificity
	---
	--- The specificity is used to determine which lockdowns should be applied/reverted in the event of multiple lockdowns
	--- handling the same roles/channels
	specificity: () -> number,

	--- Tests that a lockdown mode can in fact work
	---
	--- Should error if the lockdown mode cannot be applied
	test: (data: BaseLockdownModeData) -> (),

	--- Try to automatically fix any issues that may prevent the lockdown mode from being applied
	autofix: (data: BaseLockdownModeData) -> (),

	--- Sets up the lockdown mode, returning any data to be stored with the lockdown
	setup: (data: BaseLockdownModeData) -> any,

	--- Returns the sharable lockdown data
	shareable: (lockdown: Lockdown) -> handle.LockdownSharableData,

	--- Creates a new lockdown
	create: (data: ExtLockdownModeData) -> (),

	--- Reverts a lockdown
	revert: (data: ExtLockdownModeData) -> (),

	--- Returns the handle for the lockdown
	handle: (data: BaseLockdownModeData, lockdown: Lockdown) -> handle.LockdownModeHandle
}
PropTypeDescription
string_form
() -> string
Returns the string form of the lockdown mode
specificity
() -> number
The specificity of the lockdown mode. More specific lockdowns should have higher specificityThe specificity is used to determine which lockdowns should be applied/reverted in the event of multiple lockdownshandling the same roles/channels
test
(data: BaseLockdownModeData) -> ()
Tests that a lockdown mode can in fact workShould error if the lockdown mode cannot be applied
autofix
(data: BaseLockdownModeData) -> ()
Try to automatically fix any issues that may prevent the lockdown mode from being applied
setup
Sets up the lockdown mode, returning any data to be stored with the lockdown
shareable
Returns the sharable lockdown data
create
(data: ExtLockdownModeData) -> ()
Creates a new lockdown
revert
(data: ExtLockdownModeData) -> ()
Reverts a lockdown
handle
Returns the handle for the lockdown

RegistryCall

Raw Type
type RegistryCall = (stringform: string) -> LockdownMode?
Function Signature
(stringform: string) -> LockdownMode?

Arguments

stringform

string

Returns

ret1

LockdownMode?

LockdownModeRegistry

Raw Type
type LockdownModeRegistry = {RegistryCall}

{RegistryCall}

Functions

getLockdownMode

Function Signature
function getLockdownMode(reg: LockdownModeRegistry, stringform: string) -> LockdownMode? end

Arguments

reg

LockdownModeRegistry

stringform

string

Returns

ret1

LockdownMode?

Last updated on