add video command body

This commit is contained in:
root committed 2018-12-18 16:50:38 +08:00
1 parent 9628bdfca3
commit 1c35860c17
3 files changed
+10 -3

No files matched your search

+2
View File
@@ -28,6 +28,8 @@ func selectAct(cmd, sub, txt string, s *lineobj.SourceObject) (res string) {
return delTwitchChannel(sub, txt, s)
case "image":
return fmt.Sprintf("$image$%s", sub)
case "video":
return fmt.Sprintf("$video$%s", sub)
case "addyoutube":
return addYoutubeChannel(sub, txt, s)
case "delyoutube":
@@ -79,6 +79,13 @@ func parseResult(str string) interface{} {
OriginalContentURL: strs[0],
PreviewImageURL: strs[1],
}
} else if strings.HasPrefix(str, "$video$") {
str = strings.Replace(str, "$video$", "", 1)
strs := strings.Split(str, ";")
m = &line.VideoMessage{
OriginalContentURL: strs[0],
PreviewImageURL: strs[1],
}
} else {
m = &line.TextMessage{
Text: str,