Ice9Coffee / HoshinoBot

A qqbot for Princess Connect Re:Dive (and other usage :)
GNU General Public License v3.0
1.41k stars 411 forks source link

推特插件v2版添加 #271

Closed othinus001 closed 1 year ago

othinus001 commented 1 year ago

完成度100%,所有功能测试可用 使用须知: 1.需删除.hoshino下的twitter_uid_cache.json 2.需git clone https://github.com/odrling/peony-twitter.git,覆盖原来的peony-twitter依赖包

Ice9Coffee commented 1 year ago

Twitter API v2使用须知

  1. 修改hoshino.config.__bot__.MODULES_ON,加载twitter-v2,不要加载twitter
  2. 由于twitter的数字id发生了变化,之前的缓存与Twitter API v2获取的不一致,需删除~/.hoshino/twitter_uid_cache.json文件; Twitter API v2可以直接根据用户的name进行订阅,已移除对数字id的依赖,无需执行本步骤;
  3. 由于peony-twitter尚未正式发布支持Twitter API v2的3.x版本,请使用
    # linux
    $ python3.8 -m pip install git+https://github.com/odrling/peony-twitter.git

    # windows
    > py -3.8 -m pip install git+https://github.com/odrling/peony-twitter.git

    来安装依赖;

  4. 由于Twitter方的限制,Essential access最多5条rule,每条rule最多512字节,导致订阅数量有上限,具体上限与订阅的推主的name长度有关(我目前订阅了102个推主);
  5. 由于Twitter方的限制,Essential access有每连接每秒50条推特的上限,不建议订阅频繁发推的机器人帐号(如@Genshin_7会发送抽奖回复)。