orkestral / venom

Venom is a high-performance system developed with JavaScript to create a bot for WhatsApp, support for creating any interaction, such as customer service, media sending, sentence recognition based on artificial intelligence and all types of design architecture for WhatsApp.
https://orkestral.io
Apache License 2.0
6.13k stars 1.21k forks source link

loadAndGetAllMessagesInChat not working gives n.loadEarlierMsgs is not a function #1730

Closed qazgal1 closed 2 years ago

qazgal1 commented 2 years ago

Description

[Description of the bug, When Issue Happens]

Environment

Steps to Reproduce

  1. [First Step]
  2. [Second Step]
  3. [and so on...]

Your Code

// Supports ES6 // import { create, Whatsapp } from 'venom-bot'; const venom = require('venom-bot');

venom .create({ session: 'session-name', //name of session multidevice: true // for version not multidevice use false.(default: true) }) .then((client) => start(client)) .catch((erro) => { console.log(erro); });

async function start(client) { console.log("papa") const allMessages = await client.loadAndGetAllMessagesInChat( '972507157096@c.us' ); console.log(allMessages) console.log("mama") };

Additional context / Screenshot

Add any other context about the problem here. If applicable, add screenshots to help explain. Screenshot from 2022-06-10 17-12-34

github-actions[bot] commented 2 years ago

Thank you for joining our community, happy. We are currently fixing this bug, our new version will be released soon.

Working with Love!

macleysousa commented 2 years ago

try client.loadAndGetAllMessagesInChat('972507157096@c.us').then((data)=>{ console.log(data); }).catch(() => { })

qazgal1 commented 2 years ago

returns empty but not gives error

macleysousa commented 2 years ago

but is there any conversation in the chat?

qazgal1 commented 2 years ago

yes

qazgal1 commented 2 years ago

I checked with multiple chats and all returned empty

macleysousa commented 2 years ago

this function only loads new messages

qazgal1 commented 2 years ago

ohhhh thanks!! so what function loads all messages?

macleysousa commented 2 years ago

client.getAllMessagesInChat('00000000000@c.us', true, false).then((data) => { console.log(data); });

qazgal1 commented 2 years ago

i checked with new messages and its steal returned nothing

qazgal1 commented 2 years ago

and

client.getAllMessagesInChat('00000000000@c.us', true, false).then((data) => { console.log(data); });

that's only gave me the last seven messeges

qazgal1 commented 2 years ago

client.getAllMessagesInChat('00000000000@c.us', true, false).then((data) => { console.log(data); });

and when I ran it the second time gave me only the last messages

github-actions[bot] commented 2 years ago

This issue is stale because it has been open for 30 days with no activity.

group2tts commented 2 years ago

1758

use

const chat = Store.Chat.get('32323323@c.us');
const loadedMessages = await window.Store.ConversationMsgs.loadEarlierMsgs(chat);
github-actions[bot] commented 2 years ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 2 years ago

This issue was closed because it has been inactive for 14 days since being marked as stale.