@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
}
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
}
Prop | Type | Description |
---|---|---|
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
Variant 2
Prop | Type | Description |
---|---|---|
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
}
Prop | Type | Description |
---|---|---|
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 | Tests that a lockdown mode can in fact workShould error if the lockdown mode cannot be applied | |
autofix | 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 | Creates a new lockdown | |
revert | 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
Returns
ret1
LockdownModeRegistry
Raw Type
type LockdownModeRegistry = {RegistryCall}
Functions
getLockdownMode
Function Signature
function getLockdownMode(reg: LockdownModeRegistry, stringform: string) -> LockdownMode? end
Arguments
reg
stringform
Returns
ret1
Last updated on