fix telegram arguments index update

This commit is contained in:
c9s 2021-05-14 14:57:22 +08:00
parent abd6f4c7ef
commit e3cb2ad86c

View File

@ -12,7 +12,6 @@ type Notifier struct {
type NotifyOption func(notifier *Notifier)
// New
// TODO: register interaction with channel, so that we can route message to the specific telegram bot
func New(interaction *Interaction, options ...NotifyOption) *Notifier {
@ -38,12 +37,15 @@ func filterPlaintextMessages(args []interface{}) (texts []string, pureArgs []int
case types.PlainText:
texts = append(texts, a.PlainText())
textArgsOffset = idx
if textArgsOffset == -1 {
textArgsOffset = idx
}
case types.Stringer:
texts = append(texts, a.String())
textArgsOffset = idx
if textArgsOffset == -1 {
textArgsOffset = idx
}
}
}