-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.ts
64 lines (43 loc) · 990 Bytes
/
bot.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
import { User } from './users'
import ignore from './ignore'
export function isBot(
user: User,
): boolean {
// a bot if has 0 likes
// if (user.likes_count === 0) {
// return true
// }
// not a bot if has blue tick
if (user.verified === true) {
return false
}
// not a bot if u are following this account
if (user.following === true) {
return false
}
// not a bot if has >0 likes
if (user.likes_count > 0) {
return false
}
// not a bot if in the `ignore` list
if (ignore.includes(user.username)) {
return false
}
// not a bot if >1000 ppl follow this user
if (user.followers_count > 1000) {
return false
}
// not a bot if this account follows <500 ppl
if (user.following_count < 500) {
return false
}
// not a bot if has posted >100 times
if (user.posts_count > 100) {
return false
}
// not a bot is bio has content
if (user.bio.length !== 0) {
return false
}
return true
}