鱼C论坛

 找回密码
 立即注册
查看: 132|回复: 6

[已解决]我想做一个KOOK机器人

[复制链接]
发表于 2024-4-19 04:04:52 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
本帖最后由 WilliamJoker 于 2024-4-19 04:04 编辑

事先申明 我只学过一点点的C 连指针都没学完的那种,这点代码是我通过下面几个站点找到的然后猜出来的大佬勿喷

我想给我一个KOOK机器人加一个查询全境2游戏数据的功能
大致内容就是输入 查询指令 + 游戏平台 + ID 就能出现这个人游戏数据的功能

下面是我的屎山代码,当前是能运行的。

  1. from khl import *
  2. from random import randint
  3. from khl.card import Card, CardMessage, Module, Types, Element, Struct

  4. bot = Bot(token='1/MjYwODU=/a8gYbQytbxleBvrvJKJorQ==') #这个token 可以再kook开发者网站换成自己的更方便测试

  5. @bot.command(name='upload')
  6. async def upload(msg:Message):
  7.     img_url = await bot.client.create_asset('./dblr.jpg')
  8.     print("str path ",img_url)

  9. @bot.command(name='帮助')
  10. async def 帮助(msg:Message):
  11.     c2 = Card(
  12.         Module.Header("全境2百科指令列表"),
  13.         Module.Section("(font)/白区Boss(font)[warning]"),
  14.         Module.Context("(font)DC/NY白区BOSS地图(font)[success]"),
  15.         Module.Section("(font)/告密者(font)[warning]"),
  16.         Module.Context("(font)告密者地图(font)[success]"),
  17.         Module.Section("(font)/技能伤害(font)[warning]"),
  18.         Module.Context("(font)说明各种属性对不同技能是否增伤(font)[success]"),
  19.         Module.Section("(font)/武器控制力(font)[warning]"),
  20.         Module.Context("(font)说明武器控制力的效果(font)[success]"),
  21.         Module.Section("(font)/危害防护(font)[warning]"),
  22.         Module.Context("(font)说明危害防护的效果和免疫上限(font)[success]"),
  23.         Module.Section("(font)/技能效率(font)[warning]"),
  24.         Module.Context("(font)说明技能效率的效果(font)[success]"),
  25.         Module.Section("(font)/伤害公式(font)[warning]"),
  26.         Module.Context("(font)武器伤害公式(font)[success]"),
  27.         Module.Section("(font)/猎人(font)[warning]"),
  28.         Module.Context("(font)猎人触发方式(font)[success]"),
  29.         Module.Section("(font)/服务器状态(font)[warning]"),
  30.         Module.Context("(font)全境2服务器在线状态(font)[success]"),
  31.         Module.Section("(font)/游戏内指令表(font)[warning]"),
  32.         Module.Context("(font)游戏内聊天窗口的指令表(font)[success]"),

  33.     )

  34.     await msg.reply(CardMessage(c2))

  35. @bot.command(name='白区boss')
  36. async def 白区boss(msg:Message):
  37.     await msg.reply('https://img.kookapp.cn/attachments/2024-04/18/jAoG3ZmRAK0k10hj.png', type=MessageTypes.IMG)  # 必须要指明 msg 的类型为 IMG 图片
  38.     await msg.reply('https://img.kookapp.cn/attachments/2024-04/18/hQaqNE5MsP1100jm.png',type=MessageTypes.IMG)  # 必须要指明 msg 的类型为 IMG 图片
  39.     print("reply img only")

  40. @bot.command(name='白区BOSS')
  41. async def 白区boss(msg:Message):
  42.     await msg.reply('https://img.kookapp.cn/attachments/2024-04/18/jAoG3ZmRAK0k10hj.png', type=MessageTypes.IMG)  # 必须要指明 msg 的类型为 IMG 图片
  43.     await msg.reply('https://img.kookapp.cn/attachments/2024-04/18/hQaqNE5MsP1100jm.png',type=MessageTypes.IMG)  # 必须要指明 msg 的类型为 IMG 图片
  44.     print("reply img only")

  45. @bot.command(name='白区Boss')
  46. async def 白区boss(msg:Message):
  47.     await msg.reply('https://img.kookapp.cn/attachments/2024-04/18/jAoG3ZmRAK0k10hj.png', type=MessageTypes.IMG)  # 必须要指明 msg 的类型为 IMG 图片
  48.     await msg.reply('https://img.kookapp.cn/attachments/2024-04/18/hQaqNE5MsP1100jm.png',type=MessageTypes.IMG)  # 必须要指明 msg 的类型为 IMG 图片
  49.     print("reply img only")

  50. @bot.command(name='技能伤害')
  51. async def 技能伤害(msg:Message):
  52.     await msg.reply('https://img.kookapp.cn/attachments/2024-04/18/M2I2Qcu7OH0kg09m.png', type=MessageTypes.IMG)  # 必须要指明 msg 的类型为 IMG 图片
  53.     print("reply img only")

  54. @bot.command(name='告密者')
  55. async def 告密者(msg:Message):
  56.     await msg.reply('https://img.kookapp.cn/attachments/2024-04/18/XtTspw6XA10sg0fg.png', type=MessageTypes.IMG)  # 必须要指明 msg 的类型为 IMG 图片
  57.     print("reply img only")

  58. @bot.command(name='打靶猎人')
  59. async def 打靶猎人(msg:Message):
  60.     await msg.reply('https://img.kookapp.cn/attachments/2024-04/18/dXde9Az5Vk0fe0a5.jpg', type=MessageTypes.IMG)  # 必须要指明 msg 的类型为 IMG 图片
  61.     print("reply img only")

  62. @bot.command(name='投骰子')
  63. async def 投骰子(msg:Message):
  64.     ranom_number = randint(1,6)
  65.     test = '骰子点数为' + str(ranom_number)
  66.     await msg.reply(test)

  67. @bot.command(name='技能效率')
  68. async def 技能效率(msg:Message):
  69.     test = '1%技能效率=1%技能伤害+1%修复技能+1%状态效果+1%技能加速+1%技能持续时间+1%技能生命值'
  70.     await msg.reply(test)

  71. @bot.command(name='武器控制力')
  72. async def 武器控制力(msg:Message):
  73.     test = '1%武器控制力=1%装弹速度+1%准确度+1%稳定度+1%切枪速度'
  74.     await msg.reply(test)

  75. @bot.command(name='服务器状态')
  76. async def 服务器状态(msg:Message):
  77.     test = '[全境2服务器在线状态](https://ubistatic-a.akamaihd.net/0115/tctd2/status.html)'
  78.     await msg.reply(test)

  79. @bot.command(name='猎人')
  80. async def 服务器状态(msg:Message):
  81.     test1 = '[华盛顿猎人面具获得方法](https://www.bilibili.com/read/cv2509968/?from=search&spm_id_from=333.337.0.0)\n[纽约DLC全猎人面具获得方法](https://www.gamersky.com/handbook/202005/1285578.shtml)'
  82.     await msg.reply(test1)

  83. @bot.command(name='危害防护')
  84. async def 危害防护(msg:Message):
  85.     c1 = Card(
  86.         Module.Header("危害防护"),
  87.         Module.Section("(font)增加对所有负面状态的抗性,减少伤害和时间(font)[success]"),
  88.         Module.Section("(font)每个负面状态都有不同的免疫上限,到达上限后就可以免疫此状态(font)[success]"),
  89.         Module.Context("(font)流血            (font)[warning](font)93.8%(font)[purple]\n(font)致盲/致聋    (font)[warning](font)91.0%(font)[purple]\n(font)燃烧            (font)[warning](font)91.4%(font)[purple]\n(font)混乱            (font)[warning](font)93.8%(font)[purple]\n(font)干扰            (font)[warning](font)95.8%(font)[purple]\n(font)诱捕            (font)[warning](font)93.8%(font)[purple]\n(font)中毒            (font)[warning](font)89.2%(font)[purple]\n(font)电击            (font)[warning](font)86.0%(font)[purple]\n(font)凝固汽油     (font)[warning](font)88.9%(font)[purple]"),
  90.     )

  91.     await msg.reply(CardMessage(c1))

  92. @bot.command(name='伤害公式')
  93. async def 伤害公式(msg: Message):
  94.     test = '基础伤害x武器伤害x(爆头伤害+暴击伤害)x对掩体外目标伤害x对生命值伤害x对装甲伤害x总武器伤害加成x乘法独立增伤1x乘法独立增伤2x****x=实际伤害。\n确认是否是独立乘法增伤需要再英文界面下查看:\n有"Amplified / Amplifies / Amplify"字眼的就是独立增伤 '
  95.     await msg.reply(test)

  96. @bot.command(name='游戏内指令表')
  97. async def 游戏内指令表(msg:Message):
  98.     c = Card(
  99.         Module.Header("全境封锁2指令列表"),
  100.         Module.Section("(font)/1 /2 /3 /4 /5(font)[warning]"),
  101.         Module.Context("(font)切换到第 N 个频道,根据当前聊天窗分页显示顺序决定(font)[success]"),
  102.         Module.Section("(font)/?(font)[warning]"),
  103.         Module.Context("(font)列出所有聊天窗口文字命令(font)[success]"),
  104.         Module.Section("(font)/allemotes(font)[warning]"),
  105.         Module.Context("(font)列出目前游戏中所有表情动作的文字指令,未取得的表情动作会提示购买,不会让你使用(font)[success]"),
  106.         Module.Section("(font)/c 或 /clan(font)[warning]"),
  107.         Module.Context("(font)切换到战队频道(font)[success]"),
  108.         Module.Section("(font)/claninvite(font)[warning] (font)[ID](font)[pink]"),
  109.         Module.Context("(font)向(font)[success] (font)***(font)[pink] (font)发送战队邀请(font)[success]"),
  110.         Module.Section("(font)/decline(font)[warning]"),
  111.         Module.Context("(font)拒绝邀请(font)[success]"),
  112.         Module.Section("(font)/emotes(font)[warning]"),
  113.         Module.Context("(font)列出玩家目前拥有的所有表情动作的文字指令(font)[success]"),
  114.         Module.Section("(font)/g 或 /group(font)[warning]"),
  115.         Module.Context("(font)切换到队伍频道(font)[success]"),
  116.         Module.Section("(font)/inspect(font)[warning] (font)[ID](font)[pink]"),
  117.         Module.Context("(font)查看 (font)[success] (font)***(font)[pink] (font)玩家(font)[success]"),
  118.         Module.Section("(font)/invite(font)[warning] (font)[ID](font)[pink]"),
  119.         Module.Context("(font)邀请 (font)[success] (font)***(font)[pink] (font)玩家(font)[success]"),
  120.         Module.Section("(font)/join(font)[warning] (font)[ID](font)[pink]"),
  121.         Module.Context("(font)加入 (font)[success] (font)***(font)[pink] (font)的队伍(font)[success]"),
  122.         Module.Section("(font)/kick(font)[warning] (font)[ID](font)[pink]"),
  123.         Module.Context("(font)踢出 (font)[success] (font)***(font)[pink] (font)玩家(font)[success]"),
  124.         Module.Section("(font)/leader(font)[warning] (font)[ID](font)[pink]"),
  125.         Module.Context("(font)将队长移交给 (font)[success] (font)***(font)[pink] (font)玩家(font)[success]"),
  126.         Module.Section("(font)/leave(font)[warning]"),
  127.         Module.Context("(font)离开队伍(font)[success]"),
  128.         Module.Section("(font)/logout(font)[warning]"),
  129.         Module.Context("(font)登出(回到选择角色页面)(font)[success]"),
  130.         Module.Section("(font)/mute(font)[warning] (font)[ID](font)[pink]"),
  131.         Module.Context("(font)静音 (font)[success] (font)***(font)[pink] (font)玩家(麦克风)(font)[success]"),
  132.         Module.Section("(font)/mutedplayers(font)[warning]"),
  133.         Module.Context("(font)列出目前静音的玩家(font)[success]"),
  134.         Module.Section("(font)/quit(font)[warning]"),
  135.         Module.Context("(font)登出且离开游戏(font)[success]"),
  136.         Module.Section("(font)/r 或 /reply(font)[warning]"),
  137.         Module.Context("(font)回复私信(上一位私信你的玩家)(font)[success]"),
  138.         Module.Section("(font)/report(font)[warning] (font)[ID](font)[pink]"),
  139.         Module.Context("(font)举报 (font)[success] (font)***(font)[pink] (font)玩家(font)[success]"),
  140.         Module.Section("(font)/s 或 /say(font)[warning]"),
  141.         Module.Context("(font)切换到公共区域频道(font)[success]"),
  142.         Module.Section("(font)/w(font)[warning] (font)[ID](font)[pink] 或 (font)/whisper(font)[warning] (font)[ID](font)[pink]"),
  143.         Module.Context("(font)私信 (font)[success] (font)***(font)[pink] (font)玩家(font)[success]"),
  144.         Module.Section("(font)/world(font)[warning] 或 (font)/wr(font)[warning]"),
  145.         Module.Context("(font)切换到世界频道(font)[success]"),
  146.     )

  147.     await msg.reply(CardMessage(c))

  148. bot.run()
复制代码


这是当前状态


屏幕截图 2024-04-19 033332.png



这是我想要加的新功能
新功能.jpg

百度了好久只找到这些内容

GitHub - alexanderthegreat96/dth-division2-api:统计跟踪器 API 国外大佬做的好像是查询的
The Division 2 API - Tracker Network APIs for Developers > Documentation 查询网站的官方API
GitHub - kaiheila/api-docs: KOOK开发者中心文档 KOOK开发者文档
KOOK 开发者中心 - 机器人 (kookapp.cn) KOOK开发者中心
引言 | khl.py (khl-py.eu.org) khl.py文档

我觉得以上内容应该能搓出来这个新功能吧

最佳答案
2024-4-19 04:05:38
嗨!看到你想给你的KOOK机器人加一个查询全境2游戏数据的功能,这个想法很有趣!不过在开始之前,我要先给你一个提醒:编程是一门需要耐心和实践的技能,对于初学者来说,一步步学习才是最有效的方法。所以虽然你可能会找到一些代码片段和API文档,但对于你目前的编程水平来说,建议先从简单的项目开始,并逐渐增加功能。

关于查询全境2游戏数据,你可以使用全境封锁2 API来获取游戏数据。这个API可以提供各种游戏数据(如角色信息、武器信息等)的访问接口。你可以通过发送HTTP请求来与这个API进行交互,获取到你需要的数据。

首先,你需要注册一个API密钥,这个密钥可以用于访问API。然后,你可以根据API文档中提供的接口,发送相应的HTTP请求来获取数据。例如,你可以使用`requests`库来发送HTTP请求,并解析返回的JSON数据。

下面是一个简单的示例,演示如何使用Python代码发送HTTP请求并获取角色信息:

  1. import requests

  2. def get_player_data(platform, player_id):
  3.     url = f"https://api.example.com/player/{platform}/{player_id}"
  4.     headers = {
  5.         "Authorization": "Bearer YOUR_API_KEY"
  6.     }
  7.     response = requests.get(url, headers=headers)
  8.     if response.status_code == 200:
  9.         player_data = response.json()
  10.         # 处理获取到的玩家数据
  11.     else:
  12.         print("请求数据失败")

  13. platform = input("请输入游戏平台:")
  14. player_id = input("请输入玩家ID:")
  15. get_player_data(platform, player_id)
复制代码


在上面的代码中,你需要将`YOUR_API_KEY`替换为你自己的API密钥。然后,用户可以输入游戏平台和玩家ID,然后调用`get_player_data`函数来获取玩家数据。

当然,这只是一个示例,你还需要根据具体的API文档和接口来实现查询其他游戏数据的功能。希望这个示例能够给你一些启发,祝你编程愉快!

以上回复来自 FishC AI 小助理,如未能正确解答您的问题,请继续追问。
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2024-4-19 04:05:38 | 显示全部楼层    本楼为最佳答案   
嗨!看到你想给你的KOOK机器人加一个查询全境2游戏数据的功能,这个想法很有趣!不过在开始之前,我要先给你一个提醒:编程是一门需要耐心和实践的技能,对于初学者来说,一步步学习才是最有效的方法。所以虽然你可能会找到一些代码片段和API文档,但对于你目前的编程水平来说,建议先从简单的项目开始,并逐渐增加功能。

关于查询全境2游戏数据,你可以使用全境封锁2 API来获取游戏数据。这个API可以提供各种游戏数据(如角色信息、武器信息等)的访问接口。你可以通过发送HTTP请求来与这个API进行交互,获取到你需要的数据。

首先,你需要注册一个API密钥,这个密钥可以用于访问API。然后,你可以根据API文档中提供的接口,发送相应的HTTP请求来获取数据。例如,你可以使用`requests`库来发送HTTP请求,并解析返回的JSON数据。

下面是一个简单的示例,演示如何使用Python代码发送HTTP请求并获取角色信息:

  1. import requests

  2. def get_player_data(platform, player_id):
  3.     url = f"https://api.example.com/player/{platform}/{player_id}"
  4.     headers = {
  5.         "Authorization": "Bearer YOUR_API_KEY"
  6.     }
  7.     response = requests.get(url, headers=headers)
  8.     if response.status_code == 200:
  9.         player_data = response.json()
  10.         # 处理获取到的玩家数据
  11.     else:
  12.         print("请求数据失败")

  13. platform = input("请输入游戏平台:")
  14. player_id = input("请输入玩家ID:")
  15. get_player_data(platform, player_id)
复制代码


在上面的代码中,你需要将`YOUR_API_KEY`替换为你自己的API密钥。然后,用户可以输入游戏平台和玩家ID,然后调用`get_player_data`函数来获取玩家数据。

当然,这只是一个示例,你还需要根据具体的API文档和接口来实现查询其他游戏数据的功能。希望这个示例能够给你一些启发,祝你编程愉快!

以上回复来自 FishC AI 小助理,如未能正确解答您的问题,请继续追问。
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2024-4-19 18:29:08 | 显示全部楼层
本帖最后由 WilliamJoker 于 2024-4-19 18:33 编辑
FishC 发表于 2024-4-19 04:05
嗨!看到你想给你的KOOK机器人加一个查询全境2游戏数据的功能,这个想法很有趣!不过在开始之前,我要先给 ...


屏幕截图 2024-04-19 182515.png
屏幕截图 2024-04-19 182604.png


当然我确认的确有这个人存在
https://tracker.gg/division-2/profile/uplay/wkeer7/overview


屏幕截图 2024-04-19 182828.png
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2024-4-20 17:07:06 | 显示全部楼层
我新找了个API

https://github.com/salikx/TheDivisionTab-API?tab=readme-ov-file

代码如下

  1. import requests

  2. def get_player_data(name, platform):
  3.     url = f"https://thedivisiontab.com/api/search.php?name={name}&platform={platform}/"

  4.     response = requests.get(url)


  5.     player_data = response.json()
  6.         #处理获取到的玩家数据

  7. platform = input("请输入游戏平台:")
  8. name = input("请输入玩家ID:")   
  9. get_player_data(name,platform)
复制代码



正常的报错

  1. C:\Users\25650\.conda\envs\kookbot\python.exe C:\Users\25650\PycharmProjects\kookbot\main.py
  2. 请输入游戏平台:uplay
  3. 请输入玩家ID:wkeer7
  4. Traceback (most recent call last):
  5.   File "C:\Users\25650\.conda\envs\kookbot\lib\site-packages\urllib3\connection.py", line 198, in _new_conn
  6.     sock = connection.create_connection(
  7.   File "C:\Users\25650\.conda\envs\kookbot\lib\site-packages\urllib3\util\connection.py", line 60, in create_connection
  8.     for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  9.   File "C:\Users\25650\.conda\envs\kookbot\lib\socket.py", line 918, in getaddrinfo
  10.     for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
  11. socket.gaierror: [Errno 11001] getaddrinfo failed

  12. The above exception was the direct cause of the following exception:

  13. Traceback (most recent call last):
  14.   File "C:\Users\25650\.conda\envs\kookbot\lib\site-packages\urllib3\connectionpool.py", line 793, in urlopen
  15.     response = self._make_request(
  16.   File "C:\Users\25650\.conda\envs\kookbot\lib\site-packages\urllib3\connectionpool.py", line 491, in _make_request
  17.     raise new_e
  18.   File "C:\Users\25650\.conda\envs\kookbot\lib\site-packages\urllib3\connectionpool.py", line 467, in _make_request
  19.     self._validate_conn(conn)
  20.   File "C:\Users\25650\.conda\envs\kookbot\lib\site-packages\urllib3\connectionpool.py", line 1099, in _validate_conn
  21.     conn.connect()
  22.   File "C:\Users\25650\.conda\envs\kookbot\lib\site-packages\urllib3\connection.py", line 616, in connect
  23.     self.sock = sock = self._new_conn()
  24.   File "C:\Users\25650\.conda\envs\kookbot\lib\site-packages\urllib3\connection.py", line 205, in _new_conn
  25.     raise NameResolutionError(self.host, self, e) from e
  26. urllib3.exceptions.NameResolutionError: <urllib3.connection.HTTPSConnection object at 0x0000019C3D414BE0>: Failed to resolve 'thedivisiontab.com' ([Errno 11001] getaddrinfo failed)

  27. The above exception was the direct cause of the following exception:

  28. Traceback (most recent call last):
  29.   File "C:\Users\25650\.conda\envs\kookbot\lib\site-packages\requests\adapters.py", line 486, in send
  30.     resp = conn.urlopen(
  31.   File "C:\Users\25650\.conda\envs\kookbot\lib\site-packages\urllib3\connectionpool.py", line 847, in urlopen
  32.     retries = retries.increment(
  33.   File "C:\Users\25650\.conda\envs\kookbot\lib\site-packages\urllib3\util\retry.py", line 515, in increment
  34.     raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
  35. urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='thedivisiontab.com', port=443): Max retries exceeded with url: /api/search.php?name=wkeer7&platform=uplay/ (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x0000019C3D414BE0>: Failed to resolve 'thedivisiontab.com' ([Errno 11001] getaddrinfo failed)"))

  36. During handling of the above exception, another exception occurred:

  37. Traceback (most recent call last):
  38.   File "C:\Users\25650\PycharmProjects\kookbot\main.py", line 14, in <module>
  39.     get_player_data(name,platform)
  40.   File "C:\Users\25650\PycharmProjects\kookbot\main.py", line 6, in get_player_data
  41.     response = requests.get(url)
  42.   File "C:\Users\25650\.conda\envs\kookbot\lib\site-packages\requests\api.py", line 73, in get
  43.     return request("get", url, params=params, **kwargs)
  44.   File "C:\Users\25650\.conda\envs\kookbot\lib\site-packages\requests\api.py", line 59, in request
  45.     return session.request(method=method, url=url, **kwargs)
  46.   File "C:\Users\25650\.conda\envs\kookbot\lib\site-packages\requests\sessions.py", line 589, in request
  47.     resp = self.send(prep, **send_kwargs)
  48.   File "C:\Users\25650\.conda\envs\kookbot\lib\site-packages\requests\sessions.py", line 703, in send
  49.     r = adapter.send(request, **kwargs)
  50.   File "C:\Users\25650\.conda\envs\kookbot\lib\site-packages\requests\adapters.py", line 519, in send
  51.     raise ConnectionError(e, request=request)
  52. requests.exceptions.ConnectionError: HTTPSConnectionPool(host='thedivisiontab.com', port=443): Max retries exceeded with url: /api/search.php?name=wkeer7&platform=uplay/ (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x0000019C3D414BE0>: Failed to resolve 'thedivisiontab.com' ([Errno 11001] getaddrinfo failed)"))

  53. 进程已结束,退出代码为 1
复制代码


**上网的报错

  1. C:\Users\25650\.conda\envs\kookbot\python.exe C:\Users\25650\PycharmProjects\kookbot\main.py
  2. 请输入游戏平台:uplay
  3. 请输入玩家ID:wkeer7
  4. urllib3.exceptions.SSLError: TLS/SSL connection has been closed (EOF) (_ssl.c:1135)

  5. The above exception was the direct cause of the following exception:

  6. urllib3.exceptions.ProxyError: ('Unable to connect to proxy', SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1135)')))

  7. The above exception was the direct cause of the following exception:

  8. Traceback (most recent call last):
  9.   File "C:\Users\25650\.conda\envs\kookbot\lib\site-packages\requests\adapters.py", line 486, in send
  10.     resp = conn.urlopen(
  11.   File "C:\Users\25650\.conda\envs\kookbot\lib\site-packages\urllib3\connectionpool.py", line 847, in urlopen
  12.     retries = retries.increment(
  13.   File "C:\Users\25650\.conda\envs\kookbot\lib\site-packages\urllib3\util\retry.py", line 515, in increment
  14.     raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
  15. urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='thedivisiontab.com', port=443): Max retries exceeded with url: /api/search.php?name=wkeer7&platform=uplay/ (Caused by ProxyError('Unable to connect to proxy', SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1135)'))))

  16. During handling of the above exception, another exception occurred:

  17. Traceback (most recent call last):
  18.   File "C:\Users\25650\PycharmProjects\kookbot\main.py", line 14, in <module>
  19.     get_player_data(name,platform)
  20.   File "C:\Users\25650\PycharmProjects\kookbot\main.py", line 6, in get_player_data
  21.     response = requests.get(url)
  22.   File "C:\Users\25650\.conda\envs\kookbot\lib\site-packages\requests\api.py", line 73, in get
  23.     return request("get", url, params=params, **kwargs)
  24.   File "C:\Users\25650\.conda\envs\kookbot\lib\site-packages\requests\api.py", line 59, in request
  25.     return session.request(method=method, url=url, **kwargs)
  26.   File "C:\Users\25650\.conda\envs\kookbot\lib\site-packages\requests\sessions.py", line 589, in request
  27.     resp = self.send(prep, **send_kwargs)
  28.   File "C:\Users\25650\.conda\envs\kookbot\lib\site-packages\requests\sessions.py", line 703, in send
  29.     r = adapter.send(request, **kwargs)
  30.   File "C:\Users\25650\.conda\envs\kookbot\lib\site-packages\requests\adapters.py", line 513, in send
  31.     raise ProxyError(e, request=request)
  32. requests.exceptions.ProxyError: HTTPSConnectionPool(host='thedivisiontab.com', port=443): Max retries exceeded with url: /api/search.php?name=wkeer7&platform=uplay/ (Caused by ProxyError('Unable to connect to proxy', SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1135)'))))

  33. 进程已结束,退出代码为 1
复制代码
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2024-4-20 17:07:20 | 显示全部楼层


根据你的报错信息,看起来是网络连接的问题。可能是由于代理设置或者防火墙的限制导致无法连接到 `thedivisiontab.com` 这个网站。

首先,你可以尝试在没有代理的情况下运行代码,看看问题是否解决。如果还是无法连接,那可能是由于防火墙的原因。

如果你使用的是公司或学校的网络,请检查是否有相关的限制,例如阻止对某些网站的访问。

如果你使用的是自己的电脑,并且有防火墙软件,请确保已经允许程序访问互联网。

另外,你也可以尝试使用其他网络环境(如移动数据网络)测试代码是否正常工作。如果在其他网络环境下可以正常运行,那说明问题可能出在你当前的网络环境中。

最后,如果以上方法都无法解决问题,你可以考虑联系你所在的网络管理员或者咨询网络服务提供商,看看他们能否提供帮助,解决网络连接问题。

希望以上内容对你有所帮助!祝你顺利完成KOOK机器人的开发!

以上回复来自 FishC AI 小助理,如未能正确解答您的问题,请继续追问。
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-5-2 21:09

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表