java-wechaty icon indicating copy to clipboard operation
java-wechaty copied to clipboard

Support WECHATY_PUPPET_SERVICE_TOKEN

Open huan opened this issue 4 years ago • 3 comments

  1. Add WECHATY_PUPPET_SERVICE_TOKEN support for all our Polyglot Wechaty projects.
  2. Make WECHATY_PUPPET_HOSTIE_TOKEN an alias for WECHATY_PUPPET_SERVICE_TOKEN, and print a warning message to let the user know it was deprecated with it has been set.

Learn more from https://github.com/wechaty/wechaty/issues/2123

huan avatar Jan 23 '21 09:01 huan

I can have a look at this change this weekend, if no one volunteers.

Charles-Wu-Chen avatar Jan 27 '21 11:01 Charles-Wu-Chen

Have had a look in the code, Java wechaty library doesn't hardcode the token variable. it accepts the token as string. It is application to set up the token variable. So no change is required from this project.

https://github.com/wechaty/java-wechaty/blob/a0a374b8db2575f39306cbb0aa84b5950ff35a74/wechaty/src/main/kotlin/io/github/wechaty/Wechaty.kt#L386

I will update java-wechaty-getting-started project to reflect the token variable change.

https://github.com/wechaty/java-wechaty-getting-started/blob/63f9fe47ff03bb2722670786cca743bb13121d97/examples/src/main/java/io/github/wechaty/DingDongBot.java#L15

Charles-Wu-Chen avatar Jan 29 '21 10:01 Charles-Wu-Chen

Thanks for your information that Java Wechaty does not support setting token from environment variable yet!

It would be great if we can add a WECHATY_PUPPET_SERVICE_TOKEN environment variable to Java Wechaty so that the developers can be easy to switch the Wechaty Puppet Service by simple setting the env var.

And I'm drafting a Polygram Wechaty Specification this week (here), which all the Polygram Wechaty should apply because it will make developers easily to use Wechaty when they are switching languages.

huan avatar Jan 29 '21 15:01 huan