From 4f4ff8ae7b54c0394ef890993fc7b05d3ae6579c Mon Sep 17 00:00:00 2001 From: Vladimir Hodakov Date: Wed, 29 Nov 2017 17:34:07 +0400 Subject: [PATCH] Pinner fix for /pin spaces --- lib/pinner/pinner.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/pinner/pinner.go b/lib/pinner/pinner.go index 76713d8..462f840 100644 --- a/lib/pinner/pinner.go +++ b/lib/pinner/pinner.go @@ -80,8 +80,16 @@ func (p *Pinner) PinMessageToSomeChats(update *tgbotapi.Update) string { return "fail" } - chatsToPin := commandArgsList[0] - messageToPin := commandArgsList[1] + chatsToPin := "" + messageToPin := "" + + for i := range commandArgsList { + if i == 0 { + chatsToPin = commandArgsList[i] + } else { + messageToPin += commandArgsList[i] + } + } if messageToPin == "" { return "fail"