init puppet grpc connection
(self)
| 778 | self.on(event, listener) |
| 779 | |
| 780 | async def init_puppet(self) -> None: |
| 781 | """ |
| 782 | init puppet grpc connection |
| 783 | """ |
| 784 | # Recreate puppet instance |
| 785 | self._puppet = self._load_puppet(self._options) |
| 786 | |
| 787 | # Using metaclass to create a dynamic subclass to server multi bot instances. |
| 788 | meta_info = dict(_puppet=self.puppet, _wechaty=self, abstract=False) |
| 789 | self.ContactSelf = type('ContactSelf', (ContactSelf,), meta_info) |
| 790 | self.Contact = type('Contact', (Contact,), meta_info) |
| 791 | self.Favorite = type('Favorite', (Favorite,), meta_info) |
| 792 | self.Friendship = type('Friendship', (Friendship,), meta_info) |
| 793 | self.Image = type('Image', (Image,), meta_info) |
| 794 | self.Message = type('Message', (Message,), meta_info) |
| 795 | self.MiniProgram = type('MiniProgram', (MiniProgram,), meta_info) |
| 796 | self.UrlLink = type('UrlLink', (UrlLink,), meta_info) |
| 797 | self.Room = type('Room', (Room,), meta_info) |
| 798 | self.RoomInvitation = type('RoomInvitation', (RoomInvitation,), meta_info) |
| 799 | self.Tag = type('Tag', (Tag,), meta_info) |
| 800 | |
| 801 | async def stop(self) -> None: |
| 802 | """ |