whiTeLeaf-TL / U1bot

一个令人欢喜的娱乐机器
GNU General Public License v3.0
6 stars 3 forks source link

[feat] 使用 Github 主站路由替代对 API 的请求 #42

Closed xiaozhu2007 closed 9 months ago

xiaozhu2007 commented 9 months ago

目前已知 github.com/{用户名}.png 为用户的头像(记得处理 302 跳转),这样做可以减少一次对 Github API 的请求,避免生产中大量使用导致 Token 达到速率限制而无法提供服务

参见这几行代码:

https://github.com/wling-art/U1bot/blob/a37473ebe2ed063b000851d3882cdfba5f46f34a/src/plugins/nonebot_plugin_githubcard/data_source.py#L27-L31

For example: https://github.com/xiaozhu2007.png302 跳转到https://avatars.githubusercontent.com/u/63779340?v=4

wling-art commented 9 months ago

呃,我认为不需要,此功能较为少用,再说可以不填token会返回none执行另一个header

wling-art commented 9 months ago

如果还有问题再open吧