Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending A Sticker #358

Closed
insideheartz opened this issue Sep 28, 2020 · 2 comments · Fixed by #479
Closed

Sending A Sticker #358

insideheartz opened this issue Sep 28, 2020 · 2 comments · Fixed by #479
Labels
enhancement New feature or request

Comments

@insideheartz
Copy link

probably this is duplicate , but i tried to send a sticker in this library
but i get some problem to implement this code for injected.js

window.WWebJS.sendSticker = async (sticker, chatId, metadata, type) =>{
    var chat = await window.Store.Chat.get(chatId);

    if(chat.erro === false || chat.__x_id){
    var ListChat = await Store.Chat.get(chatId),
           stick = new window.Store.Sticker.modelClass();

    stick.__x_clientUrl = sticker.clientUrl;
    stick.__x_filehash = sticker.filehash;
    stick.__x_id = sticker.filehash;
    stick.__x_uploadhash = sticker.uploadhash;
    stick.__x_mediaKey = sticker.mediaKey;
    stick.__x_initialized = false;
    stick.__x_mediaData.mediaStage = 'INIT';
    stick.mimetype = 'image/webp';
    stick.height = metadata && metadata.height ? metadata.height : 512;
    stick.width = metadata && metadata.width ? metadata.width : 512;
    
    await stick.initialize();
    
    var result = await (Promise.all((ListChat)? await stick.sendToChat(chat, {stickerIsFirstParty: false, stickerSendOrigin: 6}) : ""));
    result = result.join('');
    var m = {type: type},
    To = await WWebJS.getChat(chatId);
   
      }else{
          return chat;
      }
}	

that's show undefinied in console
or something wrong on that?

i mean like this
jjj

hope this feature will available in this library

@insideheartz insideheartz added the enhancement New feature or request label Sep 28, 2020
@mpirescarvalho
Copy link
Contributor

Hey, check this PR

@pedroslopez pedroslopez linked a pull request Dec 25, 2020 that will close this issue
@pedroslopez
Copy link
Owner

Implemented in #479 (ff7586a) and will be released soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants