-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofanity.js
38 lines (34 loc) · 986 Bytes
/
profanity.js
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
(function(Scratch) {
'use strict'
const vm = Scratch.vm;
class profanityAPI {
getInfo () {
return {
id: 'profanityAPI',
name: 'profanityAPI',
color1: '#cf6a3c',
color2: '#cf6a3c',
color3: '#cf6a3c',
blocks: [
{
opcode: 'checkProfanity',
blockType: Scratch.BlockType.REPORTER,
text: "Remove profanity from [TEXT]",
arguments: {
TEXT: {
type: Scratch.ArgumentType.STRING,
defaultValue: 'Fuck you',
}
}
},
]
}
}
checkProfanity({TEXT}) {
return fetch("https://www.purgomalum.com/service/plain?text="+TEXT)
.then(r => r.text())
.catch(() => '');
}
}
Scratch.extensions.register(new profanityAPI());
})(Scratch);