summaryrefslogtreecommitdiff
path: root/plugins/tt.go
diff options
context:
space:
mode:
authorAlexander Kiryukhin <a.kiryukhin@mail.ru>2019-04-17 15:28:21 +0300
committerAlexander Kiryukhin <a.kiryukhin@mail.ru>2019-04-17 15:28:21 +0300
commit5a8fa8ebd73090e7b4488639b051cbf8b476d617 (patch)
treebf6a027c1392f7f6a46b4035848b8181df6b560e /plugins/tt.go
parent44d7ac1f4a93c63c8fd565667bbc358ed1697bdf (diff)
Refactoring
Diffstat (limited to 'plugins/tt.go')
-rw-r--r--plugins/tt.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/tt.go b/plugins/tt.go
index 89fa77c..9891e66 100644
--- a/plugins/tt.go
+++ b/plugins/tt.go
@@ -4,6 +4,7 @@ import (
"context"
"fmt"
"log"
+ "strings"
"github.com/neonxp/tamtam"
@@ -68,9 +69,9 @@ func (t *TamTam) Run(ctx context.Context) error {
}
case msg := <-t.Updates:
- text := fmt.Sprintf("*%s*:\n%s", msg.From, msg.Text)
+ text := fmt.Sprintf("*%s*:\n%s", strings.Trim(msg.From, " "), msg.Text)
if msg.Sticker != "" {
- text = fmt.Sprintf("*%s*: [%s]", msg.From, msg.Sticker)
+ text = fmt.Sprintf("*%s*: [%s]", strings.Trim(msg.From, " "), msg.Sticker)
}
attachments := make([]interface{}, 0, len(msg.Images))
if len(msg.Images) > 0 {