Skip to content

Commit 428af04

Browse files
authored
Merge pull request #23 from wechaty/wechaty_qrcode
use Wechaty QR Code Image Generator Service
2 parents 6e27e29 + 8b219f1 commit 428af04

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ package wechaty
4949
object DingDongBot {
5050
def main(args: Array[String]): Unit = {
5151
Wechaty.instance()
52-
.onScan(payload => { println("Scan QR Code to login: %s\nhttps://api.qrserver.com/v1/create-qr-code/?data=%s\n".format(payload.status, payload.qrcode)) })
52+
.onScan(payload => { println("Scan QR Code to login: %s\nhttps://wechaty.github.io/qrcode/%s\n".format(payload.status, payload.qrcode)) })
5353
.onLogin(payload => { println("User %s logined\n".format(payload.id)) })
5454
.onMessage(message => { println(message) })
5555
.start()

wechaty-puppet-padplus/src/main/scala/wechaty/padplus/support/ContactRawSupport.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ trait ContactRawSupport {
8585
val result = multiFormatReader.decode(binaryBitmap, hints);
8686
val payload = new EventScanPayload
8787
payload.qrcode = result.getText
88-
logger.debug("Scan QR Code to login: %s\nhttps://api.qrserver.com/v1/create-qr-code/?data=%s\n".format(payload.status, payload.qrcode))
88+
logger.debug("Scan QR Code to login: %s\nhttps://wechaty.github.io/qrcode/%s\n".format(payload.status, payload.qrcode))
8989
emit(PuppetEventName.SCAN, payload)
9090
case ResponseType.QRCODE_LOGIN =>
9191
val loginData = objectMapper.readValue(response.getData, classOf[GrpcQrCodeLogin])

wechaty/src/main/java/wechaty/JavaDingDongBot.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public static void main(String[] args) throws InterruptedException {
99
WechatyOptions option = new WechatyOptions();
1010
Wechaty bot = Wechaty.instance(option);
1111
bot
12-
.onScan(payload -> System.out.println(String.format("Scan QR Code to login: %s\nhttps://api.qrserver.com/v1/create-qr-code/?data=%s\n", payload.status().toString(), payload.qrcode())))
12+
.onScan(payload -> System.out.println(String.format("Scan QR Code to login: %s\nhttps://wechaty.github.io/qrcode/%s\n", payload.status().toString(), payload.qrcode())))
1313
.onLogin(payload -> System.out.println(String.format("User %s logined", payload.id())))
1414
.onMessage(message -> {
1515
// if (message.payload().type() != Message.MessageType.MessageTypeText() || !message.payload().text().equals("#ding")){

wechaty/src/main/scala/wechaty/DingDongBot.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ object DingDongBot {
1414

1515
bot.use(new DingDongPlugin(DingDongConfig(self = false,dm = false,at = false)))
1616
.onScan(payload => {
17-
println("Scan QR Code to login: %s\nhttps://api.qrserver.com/v1/create-qr-code/?data=%s\n".format(payload.status, payload.qrcode))
17+
println("Scan QR Code to login: %s\nhttps://wechaty.github.io/qrcode/%s\n".format(payload.status, payload.qrcode))
1818
})
1919
.onLogin(payload => {
2020
println("User %s logined\n".format(payload.id))

wechaty/src/main/scala/wechaty/DingDongPadplusBot.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ object DingDongPadplusBot {
2828
println(message.text)
2929
})
3030
.onScan(payload => {
31-
println("Scan QR Code to login: %s\nhttps://api.qrserver.com/v1/create-qr-code/?data=%s\n".format(payload.status, payload.qrcode))
31+
println("Scan QR Code to login: %s\nhttps://wechaty.github.io/qrcode/%s\n".format(payload.status, payload.qrcode))
3232
})
3333
.onLogin(payload => {
3434
println("User %s logined\n".format(payload.id))

wechaty/src/main/scala/wechaty/Wechaty.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import scala.language.implicitConversions;
2929
* @example <caption>The World's Shortest ChatBot Code: 6 lines of Scala</caption>
3030
* val options = new WechaytOptions
3131
* val bot = Wechaty.instance(options)
32-
* bot.onScan(payload => println("['https://api.qrserver.com/v1/create-qr-code/?data=',encodeURIComponent(qrcode),'&size=220x220&margin=20',].join('')"))
32+
* bot.onScan(payload => println("['https://wechaty.github.io/qrcode/',encodeURIComponent(qrcode),'&size=220x220&margin=20',].join('')"))
3333
* bot.onLogin(user => println("User ${user} logged in"))
3434
* bot.onMessage(message => println("Message: ${message}"))
3535
* bot.start()

0 commit comments

Comments
 (0)