fix: get user channel issues
This commit is contained in:
@@ -45,7 +45,16 @@ func channelExportCmd(ctx context.Context) error {
|
||||
logger.Info("get remote channel info", zap.Int64("uuid", cfg.UUID), zap.String("title", cfg.Title))
|
||||
channel, err := client.ChannelInfoByID(ctx, cfg.UUID)
|
||||
if err != nil {
|
||||
return err
|
||||
logger.Error("get channel by id failed", zap.Int64("id", cfg.UUID), zap.String("title", cfg.Title))
|
||||
if cfg.Username != "" {
|
||||
channel, err = client.ChannelInfoByAlias(ctx, cfg.Username)
|
||||
if err != nil {
|
||||
logger.Error("get channel by username failed", zap.String("username", cfg.Username), zap.String("title", cfg.Title))
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
logger.Info("exporting history msg", zap.Int64("uuid", cfg.UUID))
|
||||
|
||||
Reference in New Issue
Block a user