internal static PubsubSubscription Create(TwitchPubsubClient client, Model model) { var entity = new PubsubSubscription(client); entity.Update(model); return(entity); }
private async Task ProcessMessageAsync(PubsubFrame <string> msg) { var data = msg.GetData <PubsubInData>(); string topic = data.Topic.Split('.').First(); switch (topic) { //case "channel-bits-events-v1": // break; case "channel-subscribe-events-v1": var model = data.GetMessage <Subscription>(); await _subscriptionReceived.InvokeAsync(PubsubSubscription.Create(this, model)); break; //case "whispers": // break; default: await _anonymousReceivedEvent.InvokeAsync(data.Message); break; } }