Pre-process input via mobile share (#32)
This commit is contained in:
parent
7e4d1b7989
commit
2365907fd7
8
main.go
8
main.go
@ -312,6 +312,14 @@ func main() {
|
|||||||
|
|
||||||
// tokenize the update
|
// tokenize the update
|
||||||
tokens := strings.Split(update.Message.Text, " ")
|
tokens := strings.Split(update.Message.Text, " ")
|
||||||
|
|
||||||
|
// preprocess message based on URL schema
|
||||||
|
// in case those were added from the mobile via "Share..." option
|
||||||
|
// when it is not possible to easily prepend it with "add" command
|
||||||
|
if strings.HasPrefix(tokens[0], "magnet") || strings.HasPrefix(tokens[0], "http") {
|
||||||
|
tokens = append([]string{"add"}, tokens...)
|
||||||
|
}
|
||||||
|
|
||||||
command := strings.ToLower(tokens[0])
|
command := strings.ToLower(tokens[0])
|
||||||
|
|
||||||
switch command {
|
switch command {
|
||||||
|
Loading…
Reference in New Issue
Block a user