mikelustosa / Projeto-TInject

Projeto TInject
247 stars 132 forks source link

Error in sendMessageOptions and clearChat #22

Closed dafner closed 2 years ago

dafner commented 2 years ago

Hi everyone

I am testing the function 'sendMessageOptions' trying to send an image with the addition of buttons but 'window.Store.Validators' and 'window.Store.Wap2' are undefined:

if (options.linkPreview) {
  delete options.linkPreview;
  const link = await window.Store.Validators.findLink(content);
  if (link) {
    const preview = await window.Store.Wap2.default.queryLinkPreview(
      link.url
    );
    preview.preview = true;
    preview.subtype = 'url';
    options = { ...options, ...preview };
  }
}

I also tried the 'clearChat' function to clear one chat history but it throws the following error when executing it: "s.fromMe are undefined"

window.WAPI.clearChat = async function (id) { return await Store.ChatUtil.sendClear(Store.Chat.get(id),true);

Is there any other way to clear the history of a particular chat?

I will appreciate any help or ideas to try to solve the problem.

Thank you