From 209fc8dd35044454f92f1849b89b4d335392c406 Mon Sep 17 00:00:00 2001 From: 62918bc062e94773587808ef <62918bc062e94773587808ef@devide> Date: Thu, 27 Apr 2023 07:27:00 +0000 Subject: [PATCH] Thu Apr 27 07:27:00 UTC 2023 inscode --- 1.html | 1 + main.py | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 1.html diff --git a/1.html b/1.html new file mode 100644 index 0000000..75b6099 --- /dev/null +++ b/1.html @@ -0,0 +1 @@ +{"servers":{"vultr-miami":{"id":"xov","ipv4":"144.202.38.187","ipv6":"2001:19f0:9003:026d:5400:04ff:fe69:e71e"},"vultr-frankfurt":{"id":"xow","ipv4":"45.76.82.193","ipv6":"2001:19f0:6c01:0986:5400:04ff:fe69:e71f"},"vultr-tokyo":{"id":"xox","ipv4":"198.13.63.88","ipv6":"2001:19f0:7001:1dec:5400:04ff:fe69:e720"}}} \ No newline at end of file diff --git a/main.py b/main.py index 4c0c135..c14ae69 100644 --- a/main.py +++ b/main.py @@ -1 +1,56 @@ -print('欢迎来到 InsCode') \ No newline at end of file +# This example requires the 'message_content' intent. + +import discord +import requests +import json +headers={ + 'User-Agent':'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Mobile Safari/537.36' +} +url='https://api.n.m28.io/endpoint/florrio-map-1-green/findEach/' +param = { +} +response = requests.get(url=url,params=param,headers=headers) #三个参数 +print(type(response)) +ctx = response.text + +with open('1.html','w',encoding='utf-8') as df: + df.write(ctx) +print('保存成功') +intents = discord.Intents.default() +intents.message_content = True + +client = discord.Client(intents=intents) + +@client.event +async def on_ready(): + print(f'We have logged in as {client.user}') + +@client.event +async def on_message(message): + if message.author == client.user: + return + if message.content.startswith('.h'): + await message.channel.send("FLORR ULTRA FINDER BOT!\n You can use `.h` to get help!\n You can use `.s` to get all the servers!") + if message.content.startswith('.s'): + await message.channel.send("finding........\n") + st = "```" + for i in range(1, 1) : + headers={ + 'User-Agent':'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Mobile Safari/537.36' + } + url='https://api.ztrztr.top/api/u' + param = { + } + response = requests.get(url=url,params=param,headers=headers) #三个参数 + print(type(response.text)) + print(response.json()) + print(json.loads(response.text)) + print(type(response.json())) + ssss = str(i); + if i < 10 : + ssss = '0' + ssss + st = st + 'MAP' + ssss + ': | NA: ' + response.json()["servers"]["vultr-miami"]["id"] + " | EU: " + response.json()["servers"]["vultr-frankfurt"]["id"] + " | AS: " + response.json()["servers"]["vultr-tokyo"]["id"] + "\n" + st = st + "```" + await message.channel.send(st) + +client.run('MTA5OTE1MjI3MTEwOTAwNTUwMg.G2UpYf.vOzvjUFalWQci5CUPnFBHUmMtf9JZ5vZKNQXVM') -- GitLab