Skip to content

share the internal api externally (for example via rest) #68

Answered by Necione
asvdvl asked this question in Q&A
Discussion options

You must be logged in to vote

my goal is to implement scheduled messages

Have you tried using Puppeteer to inject a script? You can have a headless chrome window login to Discord, inject the API and then run any js script that you could use to automate your tasks.

  const apiInjectionScript = await fs.readFile('index.js', 'utf8'); // where index.js is the API script
  await page.evaluate(apiInjectionScript);

and then just

  const taskScript = await fs.readFile('somescript.js', 'utf8');
  await page.evaluate(taskScript);

This way you can have the script running on a VPS or even your own computer, and the window doesn't even need to be open since it's running on headless Chromium. You could have it setup to run mult…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@asvdvl
Comment options

@rigwild
Comment options

Answer selected by asvdvl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants