koishi-plugin-bot-ddos-protect
Version:
Provider your koishi bot with ddos protect
28 lines (27 loc) • 952 B
TypeScript
import { Context, Schema, Disposable } from 'koishi';
export function apply(ctx: Context, config: Config): void;
export interface MessageState {
count: number;
interval?: Disposable;
}
export interface Config {
echoProtect: boolean;
limit: number;
receiveMessageProtect: boolean;
sendMessageProtect: boolean;
restartTime: number;
}
export const Config: Schema<Schemastery.ObjectS<{
limit: Schema<number, number>;
restartTime: Schema<number, number>;
echoProtect: Schema<boolean, boolean>;
receiveMessageProtect: Schema<boolean, boolean>;
sendMessageProtect: Schema<boolean, boolean>;
}>, Schemastery.ObjectT<{
limit: Schema<number, number>;
restartTime: Schema<number, number>;
echoProtect: Schema<boolean, boolean>;
receiveMessageProtect: Schema<boolean, boolean>;
sendMessageProtect: Schema<boolean, boolean>;
}>>;
export const name = "bot-ddos-protect";