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

From story add to highlight reel #1754

Open
3 tasks done
jhubert41 opened this issue Feb 13, 2024 · 1 comment
Open
3 tasks done

From story add to highlight reel #1754

jhubert41 opened this issue Feb 13, 2024 · 1 comment
Labels
question unconfirmed This issue hasn't been read/confirmed/accepted by an admin

Comments

@jhubert41
Copy link

jhubert41 commented Feb 13, 2024

General Question

Read the Notes and fill out the form.
Switch to Preview for reading.

Notes

Your issue will be closed if you violate any rule below.

  • You need to include a meaningful descriptions and e.g. a screenshot.
  • You do not include screenshots of your code.
  • Read the Docs.
  • Capturing endpoints and similar can be found here
    (read it if you are going to ask about it).
  • You can delete this section after reading it.

Form

Put an [x] if you meet the condition, else leave [ ].

Question

I am having trouble adding to my highlight reel using edit Reel.

I am able to post to my story with no issuse using ig.publish.story but when I want to add that story to one of my reels using a specific highlightid I am getting undefined as the error. I am using ig.highlights.editReel.

Code

Snippet:

const buffer = canvas.toBuffer('image/jpeg');
     const publishResult = await ig.publish.story({
                    file: buffer
                  });
              
                  if (publishResult.status === 'ok' && publishResult.media && publishResult.media.id) {
                    const mediaId = publishResult.media.id;
                    console.log(`Published to Instagram story successfully. Media ID: ${mediaId}`); // Log publishing success
                    let highlightId = instagramHighlightReels[message.author.id]; 
                    console.log(`${highlightId}`);

//correct id printed to log

                   let mediaIdParts = mediaId.split('_');
                    let extractedMediaId = mediaIdParts[0];
                    console.log(`${extractedMediaId}`);
                    // This is the actual media ID needed and looks correct.
                  if (highlightId) {
                      try {
                        // Attempt to edit the reel with the given highlightId and mediaId
                        await ig.highlights.editReel({
                          highlightId: highlightId,
                          added: [extractedMediaId],
                        });
                        console.log(`Story added to existing Highlight Reel ID: ${highlightId}`);
                      } catch (publishError) {
                        // Here is the error logging part that might be causing the undefined log
                        console.error(`Error while publishing story:`, publishError.response ? publishError.response.data : publishError);
                      }
                    }
                  }

Error and Output

Error whil publishing story: undefined

YOUR WELL FORMATTED ERROR
YOUR OUTPUT GOES HERE
@jhubert41 jhubert41 added question unconfirmed This issue hasn't been read/confirmed/accepted by an admin labels Feb 13, 2024
@jhubert41
Copy link
Author

Any help on the above would be greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question unconfirmed This issue hasn't been read/confirmed/accepted by an admin
Projects
None yet
Development

No branches or pull requests

1 participant