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

I got this error! #2

Closed
JoniXTech opened this issue Oct 21, 2021 · 4 comments
Closed

I got this error! #2

JoniXTech opened this issue Oct 21, 2021 · 4 comments

Comments

@JoniXTech
Copy link

I got this error:

Connected to the Mongodb database.
[
  {
    code: 1,
    code_name: 'NotFound',
    detail: 'The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.',
    id: 'ab22b93b-739b-41d2-bef1-7c15efa69625',
    status: '404',
    title: 'Not Found'
  }
]
/Users/jonathan/Documents/Green-Bot-Dev/node_modules/patreon-discord/class/campaign.js:77
        const { allPatronsPledges: pledges, allPatronsSocials: socials } = await this._scrapeData();
                                   ^

TypeError: Cannot destructure property 'allPatronsPledges' of '(intermediate value)' as it is undefined.
    at Campaign.fetchPatrons (/Users/jonathan/Documents/Green-Bot-Dev/node_modules/patreon-discord/class/campaign.js:77:36)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
@pauldb09
Copy link

@miramallows Having a look will be realy appreciated

@miramallows
Copy link
Owner

@pauldb09 @JoniXTech Could I see your code snippets relevant to this?

@miramallows miramallows added the question Further information is requested label Dec 24, 2021
@JoniXTech
Copy link
Author

JoniXTech commented Dec 25, 2021

That´s not working in the package:

async fetchPatrons (patronStatusFilter) {

        const { allPatronsPledges: pledges, allPatronsSocials: socials } = await this._scrapeData();
        const patrons = await this._sortData(pledges, socials, patronStatusFilter)
        return patrons;

    }

And i tried this in my code:

const { Campaign } = require('patreon-discord')

const myCampaign = new Campaign({ 
                patreonToken: 'my patreonToken',
                campaignId: 'my campaignId'
            })

            myCampaign.fetchPatrons(['active_patron', 'declined_patron'])
                .then(patrons => { 
                    console.log(patrons)
                })

@miramallows
Copy link
Owner

hey @JoniXTech, i couldn't recreate this bug. I imagine it might be related to missing your campaign ID or that your campaign ID is invalid?

there's a few ways to grab the campaign id, the easiest way is going to your main page of patreon (for me, it would be https://patreon.com/mimubot ) and type this in your console.
prompt('Campaign ID',window.patreon.bootstrap.creator.data.id);

from there you'll be prompted with a copy-pasteable campaign id :)

@miramallows miramallows removed the question Further information is requested label Dec 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants