|
6 | 6 | "fmt" |
7 | 7 | "log" |
8 | 8 | "os" |
9 | | - "strings" |
10 | 9 | "time" |
11 | 10 |
|
12 | 11 | _ "github.com/mattn/go-sqlite3" |
@@ -80,7 +79,7 @@ func initClient() (*whatsmeow.Client, *sqlstore.Container, waLog.Logger) { |
80 | 79 | } |
81 | 80 |
|
82 | 81 | func main() { |
83 | | - var jidStr, header, optionsStr, text string |
| 82 | + var jidStr, header, text string |
84 | 83 | var message *waE2E.Message |
85 | 84 | var client *whatsmeow.Client |
86 | 85 | var container *sqlstore.Container |
@@ -122,12 +121,11 @@ func main() { |
122 | 121 | Arguments: []cli.Argument{ |
123 | 122 | &cli.StringArg{Name: "jid", Destination: &jidStr}, // use id field of group |
124 | 123 | &cli.StringArg{Name: "header", Destination: &header}, |
125 | | - &cli.StringArg{Name: "options", Destination: &optionsStr}, |
| 124 | + &cli.StringArgs{Name: "options", Min: 2, Max: -1}, |
126 | 125 | }, |
127 | 126 | Action: func(ctx context.Context, cmd *cli.Command) error { |
128 | 127 | // parse JID |
129 | | - var options = strings.Fields(optionsStr) |
130 | | - message = client.BuildPollCreation(header, options, 1) |
| 128 | + message = client.BuildPollCreation(header, cmd.StringArgs("options"), 1) |
131 | 129 | return nil |
132 | 130 | }, |
133 | 131 | }, |
|
0 commit comments