-
Notifications
You must be signed in to change notification settings - Fork 1
/
gm.py
53 lines (47 loc) · 1.5 KB
/
gm.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
# -*- coding: utf-8 -*-
"""
@Time : 2021/10/3 19:18
@Auth : d1rrick@scientistDAO
@File :autochat.py
@IDE :PyCharm
@Modified_by : rh9yep@scientistDAO
@Modified_time : 2021/12/15 21:08
"""
import requests
import json
import random
import time
import traceback
channel_list = []
authorization_list = []
def chat():
for authorization in authorization_list: # accounts
header = {
"Authorization":authorization,
"Content-Type":"application/json",
"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.61 Safari/537.36"
}
for channel_id in channel_list: # channels
msg = {
"content": 'gm',
"nonce": "82329451214{}33232234".format(random.randrange(0, 1000)),
"tts": False
}
url = 'https://discord.com/api/v9/channels/{}/messages'.format(channel_id)
try:
res = requests.post(url=url, headers=header, data=json.dumps(msg))
print(res.content)
time.sleep(random.randrange(10,15))
except:
print(traceback.format_exc())
break
time.sleep(random.randrange(30,50))
if __name__ == '__main__':
while True:
try:
chat()
sleeptime = random.randrange(64800, 86400) # sleep 18-24 hours
time.sleep(sleeptime)
except:
print(traceback.format_exc())
break