Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

Latest commit

 

History

History
140 lines (81 loc) · 2.05 KB

Spam.md

File metadata and controls

140 lines (81 loc) · 2.05 KB

mewbot / Spam

Class: Spam

指令冷却检测 使用示例参照 PrimaryReplier

Table of contents

Properties

Constructors

Methods

Properties

_interval

Protected _interval: number


_threshold

Protected _threshold: number


_cooldown

Protected _cooldown: number


_infos

Protected _infos: Object

Index signature

▪ [id: string]: SpamInfo

Constructors

constructor

new Spam(interval?, threshold?, cooldown?)

Parameters

Name Type Description
interval? number 连击生效间隔 单位毫秒
threshold? number 冷却连击阈值
cooldown? number 冷却时间 单位毫秒

Methods

init

init(interval?, threshold?, cooldown?): void

Parameters

Name Type
interval? number
threshold? number
cooldown? number

Returns

void


check

check(id): CheckResult

Spam检测

Parameters

Name Type Description
id string 任意id,例如用户id,话题/节点id等

Returns

CheckResult


record

record(id): void

Spam记录

Parameters

Name Type Description
id string 任意id,例如用户id,话题/节点id等

Returns

void


reset

reset(id): void

重置Spam

Parameters

Name Type Description
id string 任意id,例如用户id,话题/节点id等

Returns

void