0

I have a Python script that does an HTTP request:

import requests

# https://discord.com/api/v9/channels/1052679335221411901/messages

payload = {'content': "Smurf Supply Grand opening!\n\nFresh League of Legends NA accounts\n40-50k BE\nEmail "
                      "Unverified\n\nPayment methods: Paypal/Crypto\n\nPrice : 0.85 USD\n\nBulk discounts DM "
                      "ME\n\nGiveaway 10X accounts in bio\n\nhttps://shoppy.gg/@Hijoka "
           }

header = {'authorization': 'MTAzNTMwNDMwNTIxMDcwMzk0Mg.G7ZkQI.SJZUo_4o-_z6fmw0TQUTlWHrTXvhAMSRlWOMN4'}

r = requests.post("https://discord.com/api/v9/channels/1052679335221411901/messages", json=payload, headers=header)

I would like this to script to repeat itself every 30 minutes. How would I go about doing this?

4
  • 1
    Create a cronjob: */30 * * * * python3 my_script.py >/dev/null 2>&1 crontab-generator.org and en.wikipedia.org/wiki/Cron Commented Dec 15, 2022 at 23:41
  • while True: r = requests.post("..."); time.sleep(30 * 60) Commented Dec 15, 2022 at 23:44
  • stackoverflow.com/questions/48810440/… Commented Dec 15, 2022 at 23:45
  • @CryptoFool i did what you told me, im getting error multiple statements on one line Commented Dec 15, 2022 at 23:53

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.