feat: Simulate recording audio in chat, clear recording/typing state, standardize chatstate change function names
This commit is contained in:
parent
d35f101fac
commit
b07b38bbe8
1 changed files with 47 additions and 6 deletions
|
|
@ -256,8 +256,21 @@ exports.LoadUtils = () => {
|
|||
return false;
|
||||
};
|
||||
|
||||
window.WWebJS.typing = async (chatId) => {
|
||||
await window.Store.Wap.sendChatstateComposing(chatId);
|
||||
window.WWebJS.sendChatstate = async (state, chatId) => {
|
||||
switch(state) {
|
||||
case 'typing':
|
||||
await window.Store.Wap.sendChatstateComposing(chatId);
|
||||
break;
|
||||
case 'recording':
|
||||
await window.Store.Wap.sendChatstateRecording(chatId);
|
||||
break;
|
||||
case 'stop':
|
||||
await window.Store.Wap.sendChatstatePaused(chatId);
|
||||
break;
|
||||
default:
|
||||
throw 'Invalid chatstate';
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue