private void GotDanmakuEvent(LiveCommentInfo info) { var danmaku = new BiliBiliCommentInfo() { Id = ObjectId.GenerateNewId(DateTime.Now), Type = DanmakuType.Comment, Username = info.Username, Userid = info.Userid, Content = info.Message, IsVip = info.IsVip, IsAdmin = info.IsAdmin, LiveId = LiveId }; try { _danmakuCollection.InsertOne(danmaku); } catch (MongoBulkWriteException ex) { LogHelper.Error("Insert object error.", true, ex); } }
private void GotGiftEvent(LiveGiftInfo info) { var danmaku = new BiliBiliCommentInfo() { Id = ObjectId.GenerateNewId(DateTime.Now), Type = DanmakuType.Gift, Username = info.Username, Userid = info.Userid, GiftName = info.GiftName, GiftCount = info.Count, CostType = info.CoinType, Cost = info.CostCoin, LiveId = LiveId }; try { _danmakuCollection.InsertOne(danmaku); } catch (MongoBulkWriteException ex) { LogHelper.Error("Insert object error.", true, ex); } }