mirror of
https://github.com/c9s/bbgo.git
synced 2024-09-20 08:11:08 +00:00
fix telegram filterPlaintextMessages
This commit is contained in:
parent
eba6706b92
commit
e3a894eb7e
|
@ -2,6 +2,7 @@ package telegramnotifier
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
|
@ -55,8 +56,9 @@ func (n *Notifier) Notify(obj interface{}, args ...interface{}) {
|
|||
func filterPlaintextMessages(args []interface{}) (texts []string, pureArgs []interface{}) {
|
||||
var firstObjectOffset = -1
|
||||
for idx, arg := range args {
|
||||
rt := reflect.TypeOf(arg)
|
||||
if rt.Kind() == reflect.Ptr {
|
||||
switch a := arg.(type) {
|
||||
|
||||
case types.PlainText:
|
||||
texts = append(texts, a.PlainText())
|
||||
if firstObjectOffset == -1 {
|
||||
|
@ -70,6 +72,7 @@ func filterPlaintextMessages(args []interface{}) (texts []string, pureArgs []int
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pureArgs = args
|
||||
if firstObjectOffset > -1 {
|
||||
|
|
Loading…
Reference in New Issue
Block a user