Exemplo n.º 1
0
        private async Task TestRaidHandler(IRC.TwitchChatter chatter, string[] remainingCommand)
        {
            if (chatter.User.AuthorizationLevel < AuthorizationLevel.Admin)
            {
                communication.SendPublicChatMessage($"You are not authorized to test raid notifications, @{chatter.User.TwitchUserName}.");
                return;
            }

            string userId    = botConfig.BroadcasterId;
            int    userCount = 100;

            //Optional Raider Name
            if (remainingCommand.Length > 0)
            {
                Database.User raider = await userHelper.GetUserByTwitchLogin(remainingCommand[0]);

                if (raider is not null)
                {
                    userId = raider.TwitchUserId;
                }
            }

            //Optional Raider Count
            if (remainingCommand.Length > 1 && int.TryParse(remainingCommand[1], out int newUserCount))
            {
                userCount = newUserCount;
            }

            raidHandler.HandleRaid(userId, userCount, true);

            return;
        }
Exemplo n.º 2
0
 protected virtual void HandleRaid(IRCMessage ircMessage)
 {
     raidhandler.HandleRaid(
         raiderId: ircMessage.tags["user-id"],
         count: int.Parse(ircMessage.tags["msg-param-viewerCount"]),
         approved: true);
 }