-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
26 lines (21 loc) · 702 Bytes
/
Copy pathindex.js
File metadata and controls
26 lines (21 loc) · 702 Bytes
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
const typingTrigger = createCustomTrigger("benyamin:typing");
let current_message = "";
let getCurrentMessageRegister = register("step", () => {
let message = Client.getCurrentChatMessage();
if(message !== current_message){
current_message = message;
typingTrigger.trigger(current_message);
}
}).unregister();
register("guiOpened", function() {
// Delay to ensure Client.isInChat() works correctly
setTimeout(function() {
if(Client.isInChat()){
getCurrentMessageRegister.register();
}
}, 50)
});
register("guiClosed", function() {
current_message = "";
getCurrentMessageRegister.unregister();
});