Giter Club home page Giter Club logo

Comments (6)

why2lyj avatar why2lyj commented on June 10, 2024 1

@why2lyj this bug is fixed now. You can install the latest python-wechaty version. If you have no question, I will close this issue in one day.

@wj-Mcat let's close this issue, it wont happen after using new version, but I will still keep eyes on it.

from python-wechaty.

fish-ball avatar fish-ball commented on June 10, 2024 1

Finally the above issue is fixed in python-wecahty-puppet-hostie, and the main problem this issue is because the Friendship.is_ready function is incorrect. I've fixed them and here comes the PR.

from python-wechaty.

wj-Mcat avatar wj-Mcat commented on June 10, 2024

This is a known bug in python-wechaty, please keep eye on new version. Thank you for your issue.

from python-wechaty.

wj-Mcat avatar wj-Mcat commented on June 10, 2024

@why2lyj this bug is fixed now. You can install the latest python-wechaty version. If you have no question, I will close this issue in one day.

from python-wechaty.

fish-ball avatar fish-ball commented on June 10, 2024

The bug still exists.

Below is my bot code:

class DingDongBot(Wechaty):
    # ...
    async def on_friendship(self, friendship: Friendship):
        print(friendship)
        print(friendship.type()

async def main():
    bot = DingDongBot()
    await bot.start()

And when I make a add friendship request to the bot user, the below error occured:

2020-06-25 10:30:34,369 - Wechaty - INFO - receive <friendship> event <EventFriendshipPayload(friendship_id='8239572337309758562')>
INFO:Wechaty:receive <friendship> event <EventFriendshipPayload(friendship_id='8239572337309758562')>
2020-06-25 10:30:34,370 - FriendShip - INFO - Friendship constructor 8239572337309758562
INFO:FriendShip:Friendship constructor 8239572337309758562
2020-06-25 10:30:34,370 - Wechaty - ERROR - internal error <Friendship class can not be instanciated directly!>
ERROR:Wechaty:internal error <Friendship class can not be instanciated directly!>

from python-wechaty.

fish-ball avatar fish-ball commented on June 10, 2024

And then, I comment out the below lines under friendship.py:

def __init__(self, friendship_id: str):
        """
        initialization constructor for friendship
        """
        self.friendship_id = friendship_id
        self._payload: Optional[FriendshipPayload] = None

        log.info('Friendship constructor %s', friendship_id)

        # if self.__class__ is Friendship:
        #     raise Exception(
        #         'Friendship class can not be instanciated directly!')
        if self.puppet is None:
            raise Exception(
                'Friendship class can not be instanciated without a puppet!')

And then retry to make a friendship request to the bot user, another error occured:

INFO:FriendShip:Friendship constructor 8568343363800708622
Friendship
/home/alfred/app/python-wechaty-getting-started/python-wechaty/src/wechaty/user/friendship.py:128: RuntimeWarning: coroutine 'Friendship.ready' was never awaited
  self.ready()
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
2020-06-25 10:20:32,019 - Wechaty - ERROR - internal error <can"t load friendship payload>
ERROR:Wechaty:internal error <can"t load friendship payload>

from python-wechaty.

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.