From 572cabb9c8eb966b9a921fadca1809ea7ba7bd87 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Wed, 25 Sep 2019 21:37:18 +0800 Subject: [PATCH] chore: fix location message --- README.md | 6 +++--- plugin.go | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e57da87..f904049 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ docker: Error response from daemon: Container command Execute from the working directory: -``` +```sh docker run --rm \ -e PLUGIN_TOKEN=xxxxxxx \ -e PLUGIN_TO=xxxxxxx \ @@ -90,8 +90,8 @@ docker run --rm \ -e PLUGIN_STICKER=tests/github-logo.png \ -e PLUGIN_AUDIO=tests/audio.mp3 \ -e PLUGIN_VOICE=tests/voice.ogg \ - -e PLUGIN_LOCATION=24.9163213,121.1424972 \ - -e PLUGIN_VENUE=24.9163213,121.1424972,title,address \ + -e PLUGIN_LOCATION="24.9163213 121.1424972" \ + -e PLUGIN_VENUE="24.9163213 121.1424972 title address" \ -e PLUGIN_VIDEO=tests/video.mp4 \ -e PLUGIN_DEBUG=true \ -e PLUGIN_ONLY_MATCH_EMAIL=false \ diff --git a/plugin.go b/plugin.go index 5f9a5c5..5377af1 100644 --- a/plugin.go +++ b/plugin.go @@ -142,11 +142,10 @@ func globList(keys []string) []string { } func convertLocation(value string) (Location, bool) { - log.Println(value) var latitude, longitude float64 var title, address string var err error - values := trimElement(strings.Split(value, ",")) + values := trimElement(strings.Split(value, " ")) if len(values) < 2 { return Location{}, true