-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot-speak.js
52 lines (39 loc) · 968 Bytes
/
bot-speak.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
function msgAppLoaded() {
speak(chrome.runtime.getManifest().name + ' loaded.');
}
function msgAborted() {
speak('Process aborted.');
}
function msgTryAgain(delay) {
speak('Waiting ' + delay + 'ms to load more chats...');
}
function msgProceedProcess() {
speak('Proceed process...');
}
function msgStart() {
speak('Starting process...');
}
function msgFinished() {
speak('Everything done!');
}
function msgNoMoreMessages() {
speak('No more messages! Shutting down.');
}
function msgNeedToIgnore(word) {
speak("Ignored - Last message contains '" + word + "'");
}
function msgSpam(name) {
confirmation(name, false);
}
function msgDone(name) {
confirmation(name, true);
}
function confirmation(name, done) {
speak((done ? "Done - " : "Spam - ") + name + " sent the last message.");
}
function getTime() {
return new Date().toLocaleTimeString("pt-BR").slice(0, 5);
}
function speak(msg) {
console.log('[' + getTime() + '] ' + msg);
}