Git Product home page Git Product logo

kimigaiiwuyi / genshinuid Goto Github PK

View Code? Open in Web Editor NEW
707.0 11.0 103.0 341.38 MB

支持OneBot(QQ)、OneBotV12、QQ频道、微信、KOOK(开黑啦)、Telegram(电报)、FeiShu(飞书)、DoDo、Villa(米游社大别野)、Discord的全功能HoshinoBot/NoneBot2/Koishi/yunzai/ZeroBot原神机器人插件

Home Page: https://docs.sayu-bot.com

License: GNU General Public License v3.0

Python 100.00%
qqbot hoshino genshin-impact genshin cqhttp nonebot2 qqguildbot wechat

genshinuid's Introduction

GenshinUID

GenshinUID 4.6.1

✨支持OneBot(QQ)、QQ频道、微信、开黑啦、Telegram的全功能原神Bot插件✨

Warning

该分支并不是Nonebot2的插件,也不是任何一个其他Bot的插件,具体安装方法请参考文档

丨感谢

丨其他

  • 如果对本插件有功能建议&Bug报告,欢迎提Issue & Pr,每一条都会详细看过
  • 如果本插件对你有帮助,不要忘了点个Star~
  • 本项目仅供学习使用,请勿用于商业用途
  • 爱发电
  • GPL-3.0 License ©@KimigaiiWuyi

genshinuid's People

Contributors

coolkids avatar fujiwarachikaa avatar kimigaiiwuyi avatar lulu666lulu avatar pre-commit-ci[bot] avatar sam5440 avatar twfx1207 avatar wangyu1997 avatar wuchangjun233 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

genshinuid's Issues

关于QQ频道Bot的适配

实际上基于官方PythonSDK的频道Bot已经基本移植完成(原本移植到GolangSDK的计划废除);
但是频道个人Bot目前限制太多:
需要申请;
发送图片必须发送已备案的URL,而不能直接发送本地图片或者其他在线图床的URL;
公域Bot非备案无法发送Ark;
每日主动消息限制每个频道20条(之前是2条);

故而暂时不开源,如有希望体验(测试)的,可主动联系我,需要满足上述条件。

授权请求

大佬我可以将您的代码迁移到我自己的仓库吗?我用的是mriai机器人,通过graia-saya管理插件,我现在想将这个插件修改为saya可用的并加到自己的公开仓库里(我会在README中附上您的个人主页和本仓库的链接)

查询词云报错

查询词云,机器人都是反馈“遇到错误”
让群里别人试也一样。
打断点看了下,运行到getImg.py的119行就没往下运行了,但是进入GetCharacter方法能正常返回数据。麻烦大佬帮忙看一下

关于在私聊使用自定义图片指令后整个Bot卡死的问题

大佬您好,首先说一下我是将您的插件基本功能移植到nonebot2使用的,不知道hoshino能否绕过这个问题,手头也没有hoshino环境没法测试,不过既然hoshino是基于nonebot1开发的,想必也会出现同样的问题。

主要问题就是,腾讯的群内图片和私聊图片用的是不一样的域名,群内图片很容易就能在服务器下载,而私聊图片大概率是下不过来的。如果在私聊中使用自定义图片的指令,服务器这边下载图片用的不是异步方式也没有timeout,会导致这个方法阻塞整个bot框架,杀进程重启才能解决。

安装时显示:输入错误

我安装后使用的跟图片有关的任何指令都会提示输入错误,但是其他功能正常使用,如签到

作者你好,关于添加cookies之后一直提示未找到绑定信息

使用添加 cookies之后,显示是添加成功,uid和mys也是正常添加,可以查询。但是不能够进行每月统计和当前状态的查询一直提示是未找到绑定信息,查询词云功能提示为遇到错误。先是用hoshino,绑定cookies之后是可以进行每月统计,但是当前状态还是现实未绑定,后来换了nonebot2,每月统计也查不了了。还请麻烦作者大大解答一下

活动列表报错

12-25 16:01:29 [SUCCESS] nonebot | CQHTTP 3436954762 | [message.group.normal]: Message -837765519 from 3076823485@[群:1158894874] "活动列表"
12-25 16:01:29 [INFO] nonebot | Event will be handled by <Matcher from GenshinUID, type=message, priority=6, temp=False>
12-25 16:01:30 [INFO] nonebot | Matcher <Matcher from GenshinUID, type=message, priority=6, temp=False> running complete
12-25 16:01:30 [ERROR] nonebot | Running matcher <Matcher from GenshinUID, type=message, priority=6, temp=False> failed.
Traceback (most recent call last):
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\Scripts\nb.exe\__main__.py", line 7, in <module>
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\click\core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\click\core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\click\core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\click\core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\click\core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\nb_cli\commands\main.py", line 26, in run
    run_bot(file, app)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\nb_cli\handlers\deploy.py", line 22, in run_bot
    nonebot.run(app=f"{module_name}:{app}")
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\__init__.py", line 278, in run
    get_driver().run(host, port, *args, **kwargs)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\drivers\fastapi.py", line 256, in run
    uvicorn.run(
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\uvicorn\main.py", line 447, in run
    server.run()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\uvicorn\server.py", line 68, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 629, in run_until_complete
    self.run_forever()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\windows_events.py", line 316, in run_forever
    super().run_forever()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 596, in run_forever
    self._run_once()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 1890, in _run_once
    handle._run()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\message.py", line 128, in _check_matcher
    await _run_matcher(Matcher, bot, event, state)
> File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\message.py", line 156, in _run_matcher
    await matcher.run(bot, event, state)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\matcher.py", line 597, in run
    await handler(self, bot, event, self.state)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\handler.py", line 64, in __call__
    await self.func(
  File "C:\Users\Administrator\Desktop\stu-files\bot\go-cq\nonebot2\nonebot2/plugins\GenshinUID\__init__.py", line 212, in _
    await draw_event_pic()
  File "C:\Users\Administrator\Desktop\stu-files\bot\go-cq\nonebot2\nonebot2/plugins\GenshinUID\getImg.py", line 1329, in draw_event_pic
    base_draw.text((540, 300 + 45 + 390 + (390+90)*index+1), value["act_begin_time"] + " —— " + value["act_end_time"], (255,255,255), ys_font(42), anchor="mm")
KeyError: 'act_begin_time'

文件顺坏

下载的文件用压缩软件打开显示压缩包损坏

作者你好

我在查询深渊时自己可以查询全部,朋友只能查询部分,这种情况怎么解决呢

当米哈游通行证账号绑有其他米哈游游戏角色时,该账号主人无法通过绑定mysid方式查询

如题,有个群友除了原神还玩崩坏三,他同时绑定了mysid和uid,查询返回

Api报错,返回内容为:
{'data': None, 'message': '用户信息不匹配', 'retcode': 1008}
出现这种情况可能的UID输入错误 or 不存在

查询数据库的cache显示该mysid绑定的uid是他蹦蹦蹦的uid

让他获取cookies后添加,数据库中他所绑定的那条cookies显示的uid还是他bbb的uid,也无法用当前状态,尝试直接修改数据库把uid换成他原神的也没用。。。

校验cookies显示正常,在数据库中查看cache记录,显示该cookies可以被其他人用来查询信息。。。

看了看是优先用mysid查询,所以让他只绑定uid。可以通过uid查询

但是这个号可以通过绑定cookies来实现当前状态吗?

Cookies校验失败

插件已经在正常使用中,
于2021.11.01 18:00后功能失效,
校验全部Cookies 发现全部失效,
重新添加也全部返回失败。
疑似是MHY修改了什么?

当天添加Cookie问题

某人今天没添加Cookie查询过后,然后添加Cookie再查询不能调用自己的Cookie

cookies

cookies似乎有时间限制,当发送cookies给机器人群聊里已经绑定完米游社id和原神id,发送签到机器人提示签到失败,请检查Cookies是否失效。

校验失败!请输入正确的Cookies!

我按照正确的方式获取到了米游社的cookies,但是在私聊机器人“添加 (我获取的cookies)”后,总是出现校验失败的问题。请问这个应该怎么解决
QQ图片20211117111456

建议对查看树脂功能添加使用权限

希望能够设置成仅限管理员或群主才能使用该功能,因为群里面如果有人用了这个功能,他发了cookie,我担心到时候会有人自己账号出问题会找我,所以我想干脆禁止群里面的其他人用这个功能,仅限群主自己能用。

实在不行,至少给个能关闭查看体力这个功能的指令,虽然这个指令对我个人而言确实很实用。

查询指令出错

12-25 16:23:21 [SUCCESS] nonebot | CQHTTP 3436954762 | [message.group.normal]: Message -912602555 from 3076823485@[群:1158894874] "查询"
12-25 16:23:21 [INFO] nonebot | Event will be handled by <Matcher from GenshinUID, type=message, priority=6, temp=False>
12-25 16:23:22 [SUCCESS] nonebot | CQHTTP 3436954762 | [message_sent]: {'time': 1640420602, 'self_id': 3436954762, 'post_type': 'message_sent', 'user_id': 3436954762, 'sub_type': 'normal', 'raw_message': '输入错误!', 'group_id': 1158894874, 'font': 0, 'message': [{'data': {'text': '输入错误!'}, 'type': 'text'}], 'message_id': 1476288486, 'message_type': 'group', 'anonymous': None, 'message_seq': 20484, 'sender': {'age': 0, 'area': '', 'card': '', 'level': '', 'nickname': 'Shigure~', 'role': 'admin', 'sex': 'unknown', 'title': '', 'user_id': 3436954762}}
Traceback (most recent call last):
  File "C:\Users\Administrator\Desktop\stu-files\bot\go-cq\nonebot2\nonebot2/plugins\GenshinUID\__init__.py", line 526, in _
    bg = await draw_pic(uid[0], nickname, image, uid[1])
  File "C:\Users\Administrator\Desktop\stu-files\bot\go-cq\nonebot2\nonebot2/plugins\GenshinUID\getImg.py", line 858, in draw_pic
    for i in mys_data['data']['list']:
TypeError: string indices must be integers

为啥都不print一下 不好定位错误

请问要怎么在nonebot2上使用呢?

九月份是装在hoshino/moudules/这边的,部署完能正常运行,前段时间更新了一下,结果发现不能用了。现在安装了nonebot2,直接放在src/Plugins文件夹里运行不了吧
新手不太了解。。。

最新版本发送不了图片

[2021-11-06 22:19:22,030 genshinuid] ERROR: <class 'sqlite3.OperationalError'> occured when _ handling message -335202562.
[2021-11-06 22:19:22,031 genshinuid] ERROR: no such table: UIDDATA
Traceback (most recent call last):
File "C:\Users\foxnian7\Desktop\qqbot\HoshinoBot\hoshino\msghandler.py", line 28, in handle_message
await service_func.func(bot, event)
File "C:\Users\foxnian7\Desktop\qqbot\HoshinoBot\hoshino\modules\GenshinUID_init_.py", line 269, in _
uid = await selectDB(ev.sender['user_id'])
File "C:\Users\foxnian7\Desktop\qqbot\HoshinoBot\hoshino\modules\GenshinUID\getDB.py", line 124, in selectDB
cursor = c.execute("SELECT * FROM UIDDATA WHERE USERID = ?",(userid,))
sqlite3.OperationalError: no such table: UIDDATA
[2021-11-06 22:19:32,178 genshinuid] ERROR: <class 'sqlite3.OperationalError'> occured when _ handling message -1694366104.
[2021-11-06 22:19:32,178 genshinuid] ERROR: no such table: UIDDATA
Traceback (most recent call last):
File "C:\Users\foxnian7\Desktop\qqbot\HoshinoBot\hoshino\msghandler.py", line 28, in handle_message
await service_func.func(bot, event)
File "C:\Users\foxnian7\Desktop\qqbot\HoshinoBot\hoshino\modules\GenshinUID_init_.py", line 269, in _
uid = await selectDB(ev.sender['user_id'])
File "C:\Users\foxnian7\Desktop\qqbot\HoshinoBot\hoshino\modules\GenshinUID\getDB.py", line 124, in selectDB
cursor = c.execute("SELECT * FROM UIDDATA WHERE USERID = ?",(userid,))
sqlite3.OperationalError: no such table: UIDDATA
[2021-11-06 22:19:37,951 genshinuid] ERROR: <class 'sqlite3.OperationalError'> occured when _ handling message -906760945.
[2021-11-06 22:19:37,951 genshinuid] ERROR: no such table: UIDDATA
Traceback (most recent call last):
File "C:\Users\foxnian7\Desktop\qqbot\HoshinoBot\hoshino\msghandler.py", line 28, in handle_message
await service_func.func(bot, event)
File "C:\Users\foxnian7\Desktop\qqbot\HoshinoBot\hoshino\modules\GenshinUID_init_.py", line 269, in _
uid = await selectDB(ev.sender['user_id'])
File "C:\Users\foxnian7\Desktop\qqbot\HoshinoBot\hoshino\modules\GenshinUID\getDB.py", line 124, in selectDB
cursor = c.execute("SELECT * FROM UIDDATA WHERE USERID = ?",(userid,))
sqlite3.OperationalError: no such table: UIDDATA
[2021-11-06 22:29:17,435 hoshino] ERROR: 缺少图片资源:C:\Users\foxnian7\Desktop\qqbot\HoshinoBot\res\img\antiqks.jpg
[2021-11-06 22:29:17,436 hoshino] ERROR: [Errno 2] No such file or directory: 'C:\Users\foxnian7\Desktop\qqbot\HoshinoBot\res\img\antiqks.jpg'
Traceback (most recent call last):
File "C:\Users\foxnian7\Desktop\qqbot\HoshinoBot\hoshino\R.py", line 43, in cqcode
return MessageSegment.image(util.pic2b64(self.open()))
File "C:\Users\foxnian7\Desktop\qqbot\HoshinoBot\hoshino\R.py", line 50, in open
return Image.open(self.path)
File "C:\Users\foxnian7\AppData\Local\Programs\Python\Python38\lib\site-packages\PIL\Image.py", line 2968, in open
fp = builtins.open(filename, "rb")

关于个别uid查询突然崩溃

作者你好 很抱歉又来打扰, 在使用过程中 一开始能查询的uid 后来再查,机器人直接反馈输入错误(只有这一个uid是这样),在bot.py输出的是正常得
12-01 01:41:02 [INFO] nonebot | Event will be handled by <Matcher from GenshinUID, type=message, priority=2, temp=False>
12-01 01:41:02 [INFO] nonebot | Matcher <Matcher from GenshinUID, type=message, priority=2, temp=False> running complete,
但是Bot反馈的是 输入错误! 还请作者指点迷津 :(
(换了设备以及更换BOT账号都是同样的提示

诺艾尔名称报错

"Noelle": "诺艾尔",

api的原始数据
{'avatar_side_icon': 'https://upload-bbs.mihoyo.com/game_record/genshin/character_side_icon/UI_AvatarIcon_Side_Noel.png', 'status': 'Finished', 'remained_time': '0'}

UI_AvatarIcon_Side_Noel.png
Noelle少了le变成了Noel无法和中文名称匹配。从而导致报错

其他的暂时未知

作者你好

我在米游社获取的cookie,在私聊bot的时候发现一直校验失败,然后我更换了米游社通行证的cookie,但是还是校验失败,请问这是怎么回事,我输入指令添加之后有一格空格的,不输入空格无反应

希望加一个uid绑定QQ的功能

由于我所在的群成份比较杂,所以群名片基本都是不带uid的,每次进行查询都要先上游戏找一下uid,我希望查询过一次自己uid信息之后,会自动绑定qq和uid,这样下次查询就不用去找自己的uid了

希望增加限制每个人查询次数的功能。

最好能根据权限设置不同人可查询uid次数,比如机器人管理员无限制,群主100次,管理员50次之类的。不然有些人进群只为查询,从不冒泡。
不好实现的话,就所有人限制10次也行。
感谢大佬。

查询深渊人物等级数据显示错误

目前账号已经绑定Cookie,使用的是当前最新版Hoshino插件。
数据错误在我的班尼特在通关深渊的时候记录是69级,结果在使用本插件会得到我目前队伍的最新等级(75)。
同样的错误在查询上期深渊也可以重现。
其他挑战回顾数据例如出战次数,最强一击,元素战技释放数,元素爆发次数等均无错误。

附图:
image
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.