mewbot / Spam
指令冷却检测 使用示例参照 PrimaryReplier
• Protected
_interval: number
• Protected
_threshold: number
• Protected
_cooldown: number
• Protected
_infos: Object
▪ [id: string
]: SpamInfo
• new Spam(interval?
, threshold?
, cooldown?
)
Name | Type | Description |
---|---|---|
interval? |
number |
连击生效间隔 单位毫秒 |
threshold? |
number |
冷却连击阈值 |
cooldown? |
number |
冷却时间 单位毫秒 |
▸ init(interval?
, threshold?
, cooldown?
): void
Name | Type |
---|---|
interval? |
number |
threshold? |
number |
cooldown? |
number |
void
▸ check(id
): CheckResult
Spam检测
Name | Type | Description |
---|---|---|
id |
string |
任意id,例如用户id,话题/节点id等 |
▸ record(id
): void
Spam记录
Name | Type | Description |
---|---|---|
id |
string |
任意id,例如用户id,话题/节点id等 |
void
▸ reset(id
): void
重置Spam
Name | Type | Description |
---|---|---|
id |
string |
任意id,例如用户id,话题/节点id等 |
void