网络流行语词典,查询你不知道的那些梗或词语,适用于HoshinoBot v2
- 在
HoshinoBot/hoshino/modules
目录clone本项目git clone https://github.com/zangxx66/jiwiki.git
- 在
HoshinoBot/hoshino/config/__bot__.py
文件的MODULES_ON
里添加jiwiki
- 重启HoshinoBot
xxx是什么梗
: 查询xxx的含义小鸡词典/小鸡字典
: 查看帮助
网络流行语词典,查询你不知道的那些梗或词语
License: MIT License
网络流行语词典,查询你不知道的那些梗或词语,适用于HoshinoBot v2
HoshinoBot/hoshino/modules
目录clone本项目
git clone https://github.com/zangxx66/jiwiki.git
HoshinoBot/hoshino/config/__bot__.py
文件的MODULES_ON
里添加jiwiki
xxx是什么梗
: 查询xxx的含义小鸡词典/小鸡字典
: 查看帮助刚开始能用,突然就keyerror了,就不能再正常使用了
请问是我网络的问题吗?还是他网站的问题啊?上午还能正常用。。。
[2023-01-17 12:33:44,681 hoshino] ERROR: [Errno Expecting value]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/HoshinoBot/hoshino/modules/jiwiki/jiwiki.py", line 36, in query
res = await resp.json()
File "/root/HoshinoBot/hoshino/aiorequests.py", line 57, in json
return await run_sync_func(self.raw_response.json, **kwargs)
File "/root/HoshinoBot/hoshino/aiorequests.py", line 10, in run_sync_func
return await asyncio.get_event_loop().run_in_executor(
File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.8/dist-packages/requests/models.py", line 917, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: [Errno Expecting value]
一个小修改,就不发pr了,开个issue讨论一下。
在我使用的过程中,查询出来的结果经常与小鸡词典网页查询出的结果不一致,并不是第一个最相关的结果。
举个例子,应该易于复现:小鸡词典网页查询cdd
,抓到json中的第一个对象:
"definitions": [{
"id": 958070346,
"term": {
"id": 500490530,
"title": "cdd",
"status": "processing"
},
#删掉了没用的
"plaintext": "cdd就是臭弟弟,是指喜欢很多个人的家伙(比如我),单推的反义词\n同时也是指《BanG Dream》里户山香澄以及她的声优寺川爱美,爱美曾经说过她喜欢这个组织的原因就是因为这里有很多女人(dd本d),同时又有了「女人都是爱美的」这句话",
}]
查询结果是没问题的,title
和plaintext
都是第一个最相关的答案。换作插件进行查询,我log到的结果:
'definitions': [{
'id': 855373574,
'term': {
'id': 335197138,
'title': 'cpdd',
'status': 'processing'
},
#删掉了没用的
'content': '“[链接:CP]滴”滴的首字母缩写,意为“找个人组CP,有意请联系我”。常用于玩网络游戏的00后之中。\n此处的CP即couple(配对),指组成一对,发展情侣关系的意思。也有人会特地 说明,找cp只为玩游戏,既不谈感情,也不发展线下关系。[划掉:其实就是找个异性][划掉,链接:开黑]\n“滴滴”则是指互相聊天发消息/打卡/加好友(可能是因为[链接:QQ]的消息提示音是滴滴声)。代表一切“联系我”的含义。\n\n经常出现在游戏公屏,在[链接:QQ飞车]和[链接:王者荣耀]中最为常见。',
}],
可以看出用插件拿到的json顺序是乱的,第一个结果根本不是最相关的。对照浏览器发现是因为请求标头中缺失了Client: web
这个参数,导致请求不完整,把这个加入到插件的header中就输出正常结果了。不过在浏览器中在上述参数下面还有一个叫Client-Version: 2.6.10r
的参数,实测有没有也不影响输出,不过不太清楚会有什么影响。
查梗时均返回“没有访问权限或已被禁止使用此功能”
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.