-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDiscordSay.py
206 lines (201 loc) · 4 KB
/
DiscordSay.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
import json
import requests
import random
import time
from discord_webhook import DiscordWebhook#pip install discord_webhook
#v2rayN本地代理
#因为需要访问外网
proxy = {'http': 'http://127.0.0.1:10809',
'https': 'http://127.0.0.1:10809',
'http': 'socks5://127.0.0.1:10808',
'https': 'socks5://127.0.0.1:10808'}
#配置信息 替换""内信息
token="###"
serverid = "###"#服务器ID
channelid = "###"#频道ID
#语言库 可自行添加
mss = '''
{
"bot": [
{
"message": "所以我先肝为敬"
},
{
"message": "肝起来"
},
{
"message": "升一等大概花多久啊兄弟們"
},
{
"message": "好想升級啊"
},
{
"message": "太屌了!"
},
{
"message": "冲鸭"
},
{
"message": "纯粹的冲"
},
{
"message": "升一等大概沖多久"
},
{
"message": "冲吧,我都要快疯了。"
},
{
"message": "真的牛逼"
},
{
"message": "我疯了"
},
{
"message": "白名单我来了"
},
{
"message": "争取天亮前肝到"
},
{
"message": "加油,不要放弃"
},
{
"message": "肝呀"
},
{
"message": "我们可以的"
},
{
"message": "你狠厲害呀"
},
{
"message": "今天肝 "
},
{
"message": "哈哈哈哈"
},
{
"message": "加油啊"
},
{
"message": "还有多久啊"
},
{
"message": "加油兄弟们"
},
{
"message": "不知道给几天时间?"
},
{
"message": "起飞"
},
{
"message": "肝爆"
},
{
"message": "感谢"
},
{
"message": "给我升升升"
},
{
"message": "你们多少级了"
},
{
"message": "拿白规则只会越来越严"
},
{
"message": "肝吧"
},
{
"message": "哈哈哈哈"
},
{
"message": "吃饭"
},
{
"message": "牛牛牛"
},
{
"message": "哎"
},
{
"message": "肝爆他"
},
{
"message": "那就早点放弃"
},
{
"message": "看起来像机器+人工"
},
{
"message": "兄弟们,我觉得我们都有希望的"
},
{
"message": "水了大半天了"
},
{
"message": "都要肝肾亏了"
},
{
"message": "赶紧升级"
},
{
"message": "我完全純手工"
},
{
"message": "你还差多少啊"
},
{
"message": "小心啥啊 各位哦"
},
{
"message": "加油吧大家"
},
{
"message": "竞争太大了"
},
{
"message": "冲到明天"
},
{
"message": "升级为王"
},
{
"message": "哈哈"
},
{
"message": "各位加油~"
},
{
"message": "哈哈哈"
}
]
}
'''
header_data = {
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36",
"authorization": token,
"origin": "https://discord.com",
"referer": "https://discord.com/channels/"+serverid+"/"+channelid+""
}
url="https://discord.com/api/v9/channels/"+channelid+"/messages"
myfriend = json.loads(mss)
def abc():
a = ""
while True:
try:
print(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
mssage = myfriend["bot"][random.randint(0,len(myfriend["bot"])-1)]["message"]#随机话术
if a != mssage:
mss_data = {"content": mssage,
"tts": "false",}
r=requests.post(url=url,headers=header_data,data=mss_data,proxies=proxy)#如果不使用本地代理请删除 ,proxies=proxy
if 199 < r.status_code < 300:
print("发送成功~~~~" + str(mssage))
a=mssage
time.sleep(10)#设置延迟时间
except Exception as ex:
print(str(ex))
if __name__ == "__main__":
abc()