mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-18 03:29:14 +00:00
feat: Simulate recording audio in chat, clear recording/typing state, standardize chatstate change function names
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user