fix: issues

This commit is contained in:
Rogee
2024-09-13 11:09:52 +08:00
parent 0bd875767b
commit e4e4861d42

View File

@@ -53,7 +53,17 @@ func channelWatchCmd(ctx context.Context) error {
channel, err := client.ChannelInfoByID(ctx, ch.UUID)
if err != nil {
logger.Error("failed to get channel info", zap.Error(err), zap.Int64("uuid", ch.UUID))
logger.Error("get channel by id failed", zap.Int64("id", ch.UUID), zap.String("title", ch.Title))
if ch.Username != "" {
channel, err = client.ChannelInfoByAlias(ctx, ch.Username)
if err != nil {
logger.Error("get channel by username failed", zap.String("username", ch.Username), zap.String("title", ch.Title))
return err
}
logger.Info("channel info", zap.Int64("id", channel.ID), zap.String("title", channel.Title))
} else {
return err
}
}
if channel.GetID() == 0 {