コード例 #1
0
        internal static PubsubSubscription Create(TwitchPubsubClient client, Model model)
        {
            var entity = new PubsubSubscription(client);

            entity.Update(model);
            return(entity);
        }
コード例 #2
0
        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;
            }
        }