Code Monkey home page Code Monkey logo

Comments (9)

pandolia avatar pandolia commented on July 26, 2024

是的。为了加快自动登录的速度,自动登录只是简单的 load 一下上次登录保存的 pickle ,不会向腾讯服务器请求新的用户信息。如果需要刷新 self.nick ,可以使用手动登录。

from qqbot.

pandolia avatar pandolia commented on July 26, 2024

不需要删除 pickle ,只需要用不带参数的方式运行一下本程序就可以了。

from qqbot.

Naville avatar Naville commented on July 26, 2024

是的但这不是需要重新auth?
贼麻烦啊

from qqbot.

pandolia avatar pandolia commented on July 26, 2024

嗯,是有点麻烦。您可以在 autoLogin 方法的最后加上:

self.fetchBuddy()
self.nick = dict(self.buddy).get(self.qqNum, self.nick)

这样自动登录成功后会更新好友列表。如果自己在自己的好友列表中,那也会随之更新自己的昵称。

from qqbot.

pandolia avatar pandolia commented on July 26, 2024

经过测试,可以在 autoLogin 方法的最后加上:

    self.nick = self.smartRequest(
        url = ('http://s.web2.qq.com/api/get_friend_info2?tuin={uin}&vfwebqq={vfwebqq}&' + \
               'clientid=53999199&psessionid={psessionid}&t=0.1').format(**self.__dict__),
        Referer = 'http://s.web2.qq.com/proxy.html?v=20130916001&callback=1&id=1'
    )['nick'].encode('utf8')

这样可以更新自己的昵称。

from qqbot.

Naville avatar Naville commented on July 26, 2024

orz非常感谢,这点为什么不作为一个可选选项并入master呢

from qqbot.

pandolia avatar pandolia commented on July 26, 2024

@Naville 感谢您的帮助和支持,我已经增加了一个 refetch 命令,这样登录后如果有需要可以重新获取一下好友列表等,同时会更新自己的昵称。

from qqbot.

tetsaicn avatar tetsaicn commented on July 26, 2024

求助啊,refresh怎么调用

from qqbot.

pandolia avatar pandolia commented on July 26, 2024

2.0版中已经去掉了 refetch 命令,改为在后台每隔 5 分钟自动 fetch 一次所有联系人列表。

from qqbot.

Related Issues (20)

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.