# Discord等级提升神器--代码开源 **Published by:** [syskey](https://paragraph.com/@syskeys/) **Published on:** 2022-03-10 **URL:** https://paragraph.com/@syskeys/discord ## Content 重要说明:本人不对使用机器人后造成的任何后果负责!!! 本人不对使用机器人后造成的任何后果负责!!! 本人不对使用机器人后造成的任何后果负责!!! 本人不提供手把手教学辅助,Python 3代码都很简单,都是很基础的东西google搜下都能解决。如果实在是不太懂,可以提供手把手教学,请赏杯奶茶等等觉得你觉得对得起给你提供的价值。以下是代码:import requests import time import json import random # Discord机器人使用说明 # xxxxxxxxxxx:是频道ID,支持多个频道 # bbbbbbbbbbbbb:是账号Token,支持多个账号同时聊天 # 23行的hi是发送的内容,随意更改 # 发送消息后会立即删除,所以最好掺杂一些手动聊天的记录 def chat(): chanel_list = ['xxxxxxxxxxx','xxxxxxxxxxx','xxxxxxxxxxx'] authorization_list = ['bbbbbbbbbbbbb','bbbbbbbbbbbbb'] for authorization in authorization_list: 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 chanel_id in chanel_list: msg = { "content": "hi", "nonce": "82329451214{}33232234".format(random.randrange(0, 1000)), "tts": False } url = 'https://discord.com/api/v9/channels/{}/messages'.format(chanel_id) try: res = requests.post(url=url, headers=header,data=json.dumps(msg)) print(res.text) idMsg = json.loads(res.text)['id'] url1 = 'https://discord.com/api/v9/channels/{}/messages/{}'.format(chanel_id, idMsg) requests.delete(url=url1, headers=header) except Exception: print(Exception) continue # 取30秒到50之间的一个随机数,作为循环的间隔时间。 time.sleep(random.randrange(30, 50)) if __name__ == '__main__': while True: try: print('start') chat() # 取180秒到240之间的一个随机数,作为机器人发送消息的间隔时间。 sleeptime = random.randrange(180, 240) time.sleep(sleeptime) except: pass continue ## Publication Information - [syskey](https://paragraph.com/@syskeys/): Publication homepage - [All Posts](https://paragraph.com/@syskeys/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@syskeys): Subscribe to updates - [Twitter](https://twitter.com/skyMetaverse): Follow on Twitter