-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathmain.py
82 lines (67 loc) · 2.66 KB
/
main.py
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import requests
import random
import time
import os
from colorama import Fore
print(" ____ ____ _ ")
print(" | __ ) __ _ | _ \ __ _| |_ ___ _ __ __ _ ")
print(" | _ \ / _' | | |_) / _' | __/ _ \ '_ \ / _' | ")
print(" | |_) | (_| | | __/ (_| | || __/ | | | (_| | ")
print(" |____/ \__, | |_| \__,_|\__\___|_| |_|\__, | ")
print(" |___/ |___/ \n")
print("=================================================")
author = "Bg.Pateng"
print("Author: " + author)
script = "Push Rank Discord"
print("Script: " + script)
telegram = "@bangpateng_group"
print("Telegram: " + telegram)
youtube = "Bang Pateng"
print("Youtube: " + youtube)
print("===========================================")
print('PERINGATAN : TIDAK UNTUK DI PERJUAL-BELIKAN')
print("===========================================\n")
time.sleep(1)
channel_id = input("Masukkan ID channel: ")
waktu1 = int(input("Set Waktu Hapus Pesan: "))
waktu2 = int(input("Set Waktu Kirim Pesan: "))
time.sleep(1)
print("3")
time.sleep(1)
print("2")
time.sleep(1)
print("1")
time.sleep(1)
os.system('cls' if os.name == 'nt' else 'clear')
with open("pesan.txt", "r") as f:
words = f.readlines()
with open("token.txt", "r") as f:
authorization = f.readline().strip()
while True:
channel_id = channel_id.strip()
payload = {
'content': random.choice(words).strip()
}
headers = {
'Authorization': authorization
}
r = requests.post(f"https://discord.com/api/v9/channels/{channel_id}/messages", data=payload, headers=headers)
print(Fore.WHITE + "Sent message: ")
print(Fore.YELLOW + payload['content'])
response = requests.get(f'https://discord.com/api/v9/channels/{channel_id}/messages', headers=headers)
if response.status_code == 200:
messages = response.json()
if len(messages) == 0:
is_running = False
break
else:
time.sleep(waktu1)
message_id = messages[0]['id']
response = requests.delete(f'https://discord.com/api/v9/channels/{channel_id}/messages/{message_id}', headers=headers)
if response.status_code == 204:
print(Fore.GREEN + f'Pesan dengan ID {message_id} berhasil dihapus')
else:
print(Fore.RED + f'Gagal menghapus pesan dengan ID {message_id}: {response.status_code}')
else:
print(f'Gagal mendapatkan pesan di channel: {response.status_code}')
time.sleep(waktu2)