Skip to content

Move WECHATY_PUPPET_SERVICE_TOKEN checking code in Python Wechaty internally #49

Open
@huan

Description

@huan

if 'WECHATY_PUPPET_SERVICE_TOKEN' not in os.environ:

From the above code, we can see that we are checking the WECHATY_PUPPET_SERVICE_TOKEN in our end user's code.

I'd like to move this checking code into the Python Wechaty module inside, which will make everything clear:

  1. the user can provide a token as options to Wechaty, this will override any environment variables that already set.
  2. If the user did not provide token as options to Wechaty, then the module will use the environment variable WECHATY_PUPPET_SERVICE_TOKEN

See also: TS Wechaty Puppet Service source code:

  1. https://github.com/wechaty/wechaty-puppet-service/blob/5d7e83db2beba891ce9ee71be69542739064fc52/src/client/puppet-service.ts#L159
  2. https://github.com/wechaty/wechaty-puppet-service/blob/5d7e83db2beba891ce9ee71be69542739064fc52/src/config.ts#L13-L32

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions