forked from BlueDome77/Turbowarp-Extension-List
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProfanity API.js
35 lines (33 loc) · 864 Bytes
/
Profanity API.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
(function(Scratch) {
'use strict';
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: 'Hello, I love pizza!',
}
}
},
]
};
}
checkProfanity({TEXT}) {
return Scratch.fetch("https://www.purgomalum.com/service/plain?text=" + TEXT)
.then(r => r.text())
.catch(() => '');
}
}
Scratch.extensions.register(new profanityAPI());
})(Scratch);