@antiraid-ext/utils/stingmanager
API reference for @antiraid-ext/utils/stingmanager
@antiraid-ext/utils/stingmanager
Types
Sting
Raw Type
type Sting = {
stingId: string,
userId: discord.Snowflake,
modId: discord.Snowflake?,
stings: number,
reason: string,
created_at: datetime.DateTime,
expires_at: datetime.DateTime?
}
Prop | Type | Description |
---|---|---|
stingId | - | |
userId | - | |
modId? | - | |
stings | - | |
reason | - | |
created_at | - | |
expires_at? | - |
CreateSting
Raw Type
type CreateSting = {
userId: discord.Snowflake,
modId: discord.Snowflake?,
stings: number?,
reason: string,
expires_at: datetime.DateTime?
}
Prop | Type | Description |
---|---|---|
userId | - | |
modId? | - | |
stings? | - | |
reason | - | |
expires_at? | - |
StingManager
[[ Manages the moderation 'stings' (think bee stings!) of a user. ]]
Raw Type
--[[
Manages the moderation 'stings' (think bee stings!) of a user.
]]
type StingManager = {
--- Gets all the stings a user has accrued
getStingsOnUser: (userId: discord.Snowflake) -> {Sting},
--- Gets a single sting by its ID
getSting: (userId: discord.Snowflake, stingId: string) -> Sting?,
--- Creates a new sting for a user returning a Sting
createUserSting: (sting: CreateSting) -> Sting,
--- Sets the expiration of a sting. Repeated calls override previous expiration
setStingExpiration: (userId: discord.Snowflake, stingId: string, reason: string, expiresAt: datetime.DateTime) -> (),
--- Deletes the expiration of a sting
deleteStingExpiration: (userId: discord.Snowflake, stingId: string) -> (),
--- Deletes a sting. Note that this does not delete the expiration task (use fullyDeleteSting if you want to do that)
deleteSting: (userId: discord.Snowflake, stingId: string, mod: string?, auditReason: string) -> (),
--- Returns the cached list of stings for a user. If the cache is expired, it will fetch the stings from the kv store
getCachedUserStings: (userId: string) -> {Sting},
--- Manually update the cached list of stings for a user
--- This is useful for when you know the stings have changed and you want to update the cache
updateCachedUserStings: (userId: string, stings: {Sting}) -> nil,
--- Clears the cached list of stings for a user
clearCachedUserStings: (userId: string) -> nil,
--- Compactly stringifies a sting
stingCompactString: (sting: Sting) -> string
}
Prop | Type | Description |
---|---|---|
getStingsOnUser | Gets all the stings a user has accrued | |
getSting | Gets a single sting by its ID | |
createUserSting | Creates a new sting for a user returning a Sting | |
setStingExpiration | Sets the expiration of a sting. Repeated calls override previous expiration | |
deleteStingExpiration | Deletes the expiration of a sting | |
deleteSting | Deletes a sting. Note that this does not delete the expiration task (use fullyDeleteSting if you want to do that) | |
getCachedUserStings | Returns the cached list of stings for a user. If the cache is expired, it will fetch the stings from the kv store | |
updateCachedUserStings | Manually update the cached list of stings for a userThis is useful for when you know the stings have changed and you want to update the cache | |
clearCachedUserStings | Clears the cached list of stings for a user | |
stingCompactString | Compactly stringifies a sting |
Functions
StingManager
2 minutes
Function Signature
-- 2 minutes
function StingManager(ctx: Primitives.TemplateContext) -> StingManager end
Arguments
ctx
Returns
ret1
Last updated on