예제 #1
0
        public override Task ConsumeCommandSpecific(ChatCommandReceivedEvent chatCommandReceivedEvent)
        {
            var channelUpdate = new UpdateChannelEvent
            {
                Title = chatCommandReceivedEvent.CommandArgs,
                Game  = null
            };

            eventBus.Publish(channelUpdate);
            return(Task.CompletedTask);
        }
예제 #2
0
        public void UpdateChannel(UpdateChannelEvent updateChannelEvent)
        {
            TwitchConfiguration twitchConfiguration = configurationManager.LoadConfiguration <TwitchConfiguration>();

            api.V5.Channels.GetChannelByIDAsync(twitchConfiguration.BroadcasterUserId)
            .ContinueWith(task =>
            {
                updateChannelEvent.Update(task.Result);
                return(api.V5.Channels.UpdateChannelAsync(twitchConfiguration.BroadcasterUserId, updateChannelEvent.Title, updateChannelEvent.Game));
            })
            .ContinueWith(task => task.Result.ContinueWith(x => PublishSuccessMessageOnCompletion(x)));
        }