-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
30 lines (24 loc) · 942 Bytes
/
Copy pathmain.py
File metadata and controls
30 lines (24 loc) · 942 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import requests
import time
url = "https://discord.com/api/v9/channels/903164072856547360/messages" # Replace with the appropriate channel URL
image_path = "try.jpg" # Replace with the path to your image file
header = {
'Authorization': 'NzU1MDczNzQ2MTgzNjUxMzMy.GDNqQv.3SLh6Ykk-2BYII_LZvmMnLLEqyQ3iSGN0XS5lI'
}
while True:
try:
payload = {
'content': "MQvEQsQSYXGvthiXbh6YPVnhES59UqXQcb",
}
files = {
'file': open(image_path, 'rb'),
}
r = requests.post(url, headers=header, data=payload, files=files)
r.raise_for_status() # Raise an exception if the request was unsuccessful
# print("Message sent successfully")
except requests.exceptions.RequestException:
# print("Error sending message:", str(e))
# print("Retrying in 1 second...")
pass
# Add a delay of 30 seconds before the next iteration
time.sleep(60)