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

random-puppy package seems to no longer work (at least for subreddits) #8

Open
comicallybad opened this issue Dec 26, 2022 · 0 comments

Comments

@comicallybad
Copy link

I haven't changed my meme command for my discord bot in years, but I guess it is broken now 🥹
The host/URL seems to be what's wrong every time. It's assuming Imgur every time.

Code:

try {
    const subReddits = ["dankmemes", "dankmeme", "meme", "PrequelMemes", "EdgelordMemes", "ProgrammerHumor"];
    const random = subReddits[Math.floor(Math.random() * subReddits.length)];

    console.log(random);

    const img = await randomPuppy(random);
    while (img == undefined) await randomPuppy(random);

    console.log(img);
} catch (err) {
    console.log(err)
}

Output every time:

PrequelMemes
ErrorClass [HTTPError]: Response code 404 (Not Found)
    at C:\Users\amp56\Documents\Projects\ComicallyBot\node_modules\random-puppy\node_modules\got\index.js:123:13
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  host: 'imgur.com',
  hostname: 'imgur.com',
  method: 'GET',
  path: '/r/PrequelMemes/hot.json',
  statusCode: 404,
  statusMessage: 'Not Found'
}
meme
ErrorClass [HTTPError]: Response code 404 (Not Found)
    at C:\Users\amp56\Documents\Projects\ComicallyBot\node_modules\random-puppy\node_modules\got\index.js:123:13
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  host: 'imgur.com',
  hostname: 'imgur.com',
  method: 'GET',
  path: '/r/meme/hot.json',
  statusCode: 404,
  statusMessage: 'Not Found'
}
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

1 participant