35 lines
623 B
Go
Raw Normal View History

2017-10-06 10:44:55 +00:00
package main
import (
"flag"
2019-04-23 05:45:17 +00:00
"github.com/akyoto/color"
2019-06-03 09:32:43 +00:00
"github.com/animenotifier/notify.moe/arn"
2017-10-06 10:44:55 +00:00
)
// Shell parameters
var confirmed bool
// Shell flags
func init() {
flag.BoolVar(&confirmed, "confirm", false, "Confirm that you really want to execute this.")
flag.Parse()
}
func main() {
if !confirmed {
color.Green("Please run this command with -confirm option if you really want to delete all pro subscriptions.")
return
}
color.Yellow("Deleting all pro subscriptions")
2017-11-01 19:11:05 +00:00
defer arn.Node.Close()
2017-10-06 10:44:55 +00:00
2017-11-01 19:11:05 +00:00
for user := range arn.StreamUsers() {
2017-10-06 11:03:36 +00:00
user.ProExpires = ""
2017-11-01 19:11:05 +00:00
user.Save()
2017-10-06 10:44:55 +00:00
}
color.Green("Finished.")
}