get user self Args: None Examples: >>> from wechaty import Wechaty >>> bot = Wechaty() >>> contact = bot.user_self() Returns: ContactSelf: user self
(self)
| 816 | log.info('wechaty has been stopped gracefully!') |
| 817 | |
| 818 | def user_self(self) -> ContactSelf: |
| 819 | """ |
| 820 | get user self |
| 821 | Args: |
| 822 | None |
| 823 | Examples: |
| 824 | >>> from wechaty import Wechaty |
| 825 | >>> bot = Wechaty() |
| 826 | >>> contact = bot.user_self() |
| 827 | Returns: |
| 828 | ContactSelf: user self |
| 829 | """ |
| 830 | user_id = self.puppet.self_id() |
| 831 | user = self.ContactSelf.load(user_id) |
| 832 | # cast Contact -> ContactSelf |
| 833 | user = cast(ContactSelf, user) |
| 834 | return user |
| 835 | |
| 836 | def self(self) -> ContactSelf: |
| 837 | """ |