add exporter offset

This commit is contained in:
Rogee
2024-09-02 11:39:47 +08:00
parent e43fa0f078
commit b00e24efc4
3 changed files with 23 additions and 27 deletions

View File

@@ -9,8 +9,10 @@ import (
)
var (
channelID int64
channelAlias string
channelID int64
offsetID int
channelAlias string
downloadMedia bool
)
func ExportCmd() *cobra.Command {
@@ -35,12 +37,19 @@ func ExportCmd() *cobra.Command {
return err
}
}
return client.Channel(ctx, channel, 0)
if downloadMedia {
client.WithMedia()
}
return client.Channel(ctx, channel, offsetID)
}),
}
cmd.Flags().Int64Var(&channelID, "channel", 0, "channel id")
cmd.Flags().IntVar(&offsetID, "offset", 0, "offset id")
cmd.Flags().StringVar(&channelAlias, "alias", "", "channel alias")
cmd.Flags().BoolVar(&downloadMedia, "media", false, "download media")
return cmd
}