Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
CyrilPeponnet committed Apr 16, 2020
1 parent 1a4e207 commit f89613f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions plugin/bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (s *Bot) ExtractFeaturesFromMessage(message string) (features []MessageFeat
ID: ci.ID,
})
// User
case strings.HasPrefix(m[1], "#U") || strings.HasPrefix(m[1], "#W"):
case strings.HasPrefix(m[1], "@U") || strings.HasPrefix(m[1], "@W"):
u := strings.Split(m[1], "|")[0]
ui, err := s.GetCachedUserInfos(u[1:])
if err != nil {
Expand Down Expand Up @@ -107,11 +107,13 @@ func (s *Bot) ExtractFeaturesFromMessage(message string) (features []MessageFeat
// regular link
default:
l := strings.Split(m[1], "|")
features = append(features, MessageFeature{
Type: TypeLink,
Value: l[1],
ID: l[0],
})
if len(l) == 2 {
features = append(features, MessageFeature{
Type: TypeLink,
Value: l[1],
ID: l[0],
})
}
}
}

Expand Down

0 comments on commit f89613f

Please sign in to comment.