add ONLY_MATCH_EMAIL boolean flag
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
e0760eaf80
commit
eee4278af4
32
main.go
32
main.go
@ -77,6 +77,11 @@ func main() {
|
|||||||
Usage: "enable debug message",
|
Usage: "enable debug message",
|
||||||
EnvVar: "PLUGIN_DEBUG",
|
EnvVar: "PLUGIN_DEBUG",
|
||||||
},
|
},
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "match.email",
|
||||||
|
Usage: "send message when only match email",
|
||||||
|
EnvVar: "PLUGIN_ONLY_MATCH_EMAIL",
|
||||||
|
},
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "format",
|
Name: "format",
|
||||||
Value: "markdown",
|
Value: "markdown",
|
||||||
@ -175,19 +180,20 @@ func run(c *cli.Context) error {
|
|||||||
Finished: c.Float64("job.finished"),
|
Finished: c.Float64("job.finished"),
|
||||||
},
|
},
|
||||||
Config: Config{
|
Config: Config{
|
||||||
Token: c.String("token"),
|
Token: c.String("token"),
|
||||||
Debug: c.Bool("debug"),
|
Debug: c.Bool("debug"),
|
||||||
To: c.StringSlice("to"),
|
MatchEmail: c.Bool("match.email"),
|
||||||
Message: c.StringSlice("message"),
|
To: c.StringSlice("to"),
|
||||||
Photo: c.StringSlice("photo"),
|
Message: c.StringSlice("message"),
|
||||||
Document: c.StringSlice("document"),
|
Photo: c.StringSlice("photo"),
|
||||||
Sticker: c.StringSlice("sticker"),
|
Document: c.StringSlice("document"),
|
||||||
Audio: c.StringSlice("audio"),
|
Sticker: c.StringSlice("sticker"),
|
||||||
Voice: c.StringSlice("voice"),
|
Audio: c.StringSlice("audio"),
|
||||||
Location: c.StringSlice("location"),
|
Voice: c.StringSlice("voice"),
|
||||||
Video: c.StringSlice("video"),
|
Location: c.StringSlice("location"),
|
||||||
Venue: c.StringSlice("venue"),
|
Video: c.StringSlice("video"),
|
||||||
Format: c.String("format"),
|
Venue: c.StringSlice("venue"),
|
||||||
|
Format: c.String("format"),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
27
plugin.go
27
plugin.go
@ -36,19 +36,20 @@ type (
|
|||||||
|
|
||||||
// Config for the plugin.
|
// Config for the plugin.
|
||||||
Config struct {
|
Config struct {
|
||||||
Token string
|
Token string
|
||||||
Debug bool
|
Debug bool
|
||||||
To []string
|
MatchEmail bool
|
||||||
Message []string
|
To []string
|
||||||
Photo []string
|
Message []string
|
||||||
Document []string
|
Photo []string
|
||||||
Sticker []string
|
Document []string
|
||||||
Audio []string
|
Sticker []string
|
||||||
Voice []string
|
Audio []string
|
||||||
Location []string
|
Voice []string
|
||||||
Video []string
|
Location []string
|
||||||
Venue []string
|
Video []string
|
||||||
Format string
|
Venue []string
|
||||||
|
Format string
|
||||||
}
|
}
|
||||||
|
|
||||||
// Plugin values.
|
// Plugin values.
|
||||||
|
Loading…
Reference in New Issue
Block a user