-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathindex.d.ts
127 lines (109 loc) · 3.06 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
import { EventEmitter } from "events";
import {
PermissionResolvable,
Snowflake,
User,
Guild,
TextChannel,
GuildMember,
Message,
DiscordAPIError,
Role,
} from "discord.js";
declare module "discord-anti-spam" {
class AntiSpam extends EventEmitter {
constructor(options?: AntiSpamOptions);
public options: AntiSpamOptions;
public data: AntiSpamData;
public message(message: Message): Promise<boolean>;
public resetData(): AntiSpamData;
public on(
event: "banAdd" | "kickAdd" | "warnAdd" | "muteAdd",
listener: (member: GuildMember) => any
): this;
public on(
event:
| "spamThresholdBan"
| "spamThresholdKick"
| "spamThresholdWarn"
| "spamThresholdMute",
listener: (member: GuildMember, duplicateMessages: boolean) => any
): this;
public on(
event: "error",
listener: (
message: Message,
error: DiscordAPIError,
type: "ban" | "kick" | "mute"
) => any
): this;
}
type AntiSpamData = {
messageCache: {
messageID: string;
content: string;
author: Snowflake;
time: number;
}[];
bannedUsers: Snowflake[];
kickedUsers: Snowflake[];
warnedUsers: Snowflake[];
};
type AntiSpamOptions = {
warnThreshold?: number;
muteThreshold?: number;
kickThreshold?: number;
banThreshold?: number;
maxInterval?: number;
maxDuplicatesInterval?: number;
maxDuplicatesWarn?: number;
maxDuplicatesMute?: number;
maxDuplicatesKick?: number;
maxDuplicatesBan?: number;
unMuteTime?: number;
modLogsChannelName?: string;
modLogsEnabled?: boolean;
modLogsMode?: "embed" | "message";
warnMessage?: string;
muteMessage?: string;
kickMessage?: string;
banMessage?: string;
actionInEmbed?: boolean;
actionEmbedIn?: "channel" | "dm";
actionEmbedColor?: string;
embedFooterIconURL?: string;
embedTitleIconURL?: string;
warnEmbedTitle?: string;
kickEmbedTitle?: string;
muteEmbedTitle?: string;
banEmbedTitle?: string;
warnEmbedDescription?: string;
kickEmbedDescription?: string;
muteEmbedDescription?: string;
banEmbedDescription?: string;
warnEmbedFooter?: string;
kickEmbedFooter?: string;
muteEmbedFooter?: string;
banEmbedFooter?: string;
errorMessages?: boolean;
kickErrorMessage?: string;
banErrorMessage?: string;
muteErrorMessage?: string;
ignoredMembers?: Snowflake[] | ((user: User) => boolean);
ignoredRoles?: (Snowflake | string)[] | ((role: Role) => boolean);
ignoredGuilds?: Snowflake[] | ((guild: Guild) => boolean);
ignoredChannels?: Snowflake[] | ((channel: TextChannel) => boolean);
ignoredPermissions?: PermissionResolvable[];
ignoreBots?: boolean;
warnEnabled?: boolean;
kickEnabled?: boolean;
banEnabled?: boolean;
muteEnabled?: boolean;
deleteMessagesAfterBanForPastDays?: number;
verbose?: boolean;
debug?: boolean;
removeMessages?: boolean;
MultipleSanctions?: boolean;
};
export default AntiSpam;
}