0

I would like to create a bot that sends a request (post) via a command /refresh with certain information so where I say /refresh test and it then sends a POST with certain information that is given for the time being.

Like this

client_id=CLIENT_ID_HERE&client_secret=CLIENT_SECRET_HERE&refresh_token=REFRESH_TOKEN_HERE&grant_type=refresh_token&redirect_uri=REDIRECT_URI_HERE

but don't know how.

pppery
  • 3,731
  • 22
  • 33
  • 46
Proximo
  • 11

1 Answers1

2

So I reread this now many times. If I understood it right now, you just want to post something to, for example https://example.com/post

If so, then use aiohttp and create a client session and post it.

import aiohttp

#this in your command
async with aiohttp.ClientSession() as session:
    await session.post(“https://example.org/post“, data={“foo”:”bar”})
Kejax
  • 349
  • 6