예제 #1
0
        private void ClientPubSub_OnChannelPointsRewardRedeemed(object sender, TwitchLib.PubSub.Events.OnChannelPointsRewardRedeemedArgs e)
        {
            RegisterTwitchUser(e.RewardRedeemed.Redemption.User.DisplayName, e.RewardRedeemed.Redemption.User.Id);
            int points = e.RewardRedeemed.Redemption.Reward.Cost / 100;

            RewardTwitchUser(e.RewardRedeemed.Redemption.User.DisplayName,
                             points, $"redeeming channel points reward '{e.RewardRedeemed.Redemption.Reward.Title}'");
        }
예제 #2
0
        //private void Pubsub_OnRewardRedeemed(object sender, TwitchLib.PubSub.Events.OnRewardRedeemedArgs e)
        //{
        //    var player = playerProvider.Get(e.Login);
        //    var cmd = commandProvider.GetCommand(player, e.RewardTitle, e.RewardPrompt);
        //    if (cmd != null)
        //        commandHandler.HandleAsync(this, cmd);
        //}

        private void Pubsub_OnChannelPointsRewardRedeemed(object sender, TwitchLib.PubSub.Events.OnChannelPointsRewardRedeemedArgs e)
        {
            var player = playerProvider.Get(e.RewardRedeemed.Redemption.User.Login);
            var cmd    = commandProvider.GetCommand(player, e.RewardRedeemed.Redemption.Reward.Title, e.RewardRedeemed.Redemption.Reward.Prompt);

            if (cmd != null)
            {
                commandHandler.HandleAsync(this, cmd);
            }
        }
예제 #3
0
 private async void Pubsub_OnChannelPointsRewardRedeemed(object sender, TwitchLib.PubSub.Events.OnChannelPointsRewardRedeemedArgs e)
 {
     logger.LogDebug("Channel Point Reward Redeemed: " + e.RewardRedeemed?.Redemption?.Reward?.Title + ", by " + e.RewardRedeemed?.Redemption?.User?.Login + ", at " + e.ChannelId);
     await commandHandler.HandleAsync(game, this, e);
 }