Example #1
0
 public async Task <PartyUpRequestResult> PopRequestedPartyMember(int gameId, int broadcasterId)
 {
     return(await ApiBotRequest.DeleteExecuteTaskAsync <PartyUpRequestResult>(_twitchBotApiLink + $"partyuprequests/deletefirst/{broadcasterId}?gameid={gameId}"));
 }
 public async Task UpdateInGameUsername(int id, int broadcasterId, InGameUsername ign)
 {
     await ApiBotRequest.PutExecuteTaskAsync(_twitchBotApiLink + $"ingameusernames/update/{broadcasterId}?id={id}", ign);
 }
Example #3
0
 public async Task <List <PartyUpRequestResult> > GetRequestList(int gameId, int broadcasterId)
 {
     return(await ApiBotRequest.GetExecuteTaskAsync <List <PartyUpRequestResult> >(_twitchBotApiLink + $"partyuprequests/getlist/{broadcasterId}?gameId={gameId}"));
 }
Example #4
0
 public async Task <SongRequestBlacklist> DeleteSongFromBlacklist(string title, string artist, int broadcasterId)
 {
     return(await ApiBotRequest.DeleteExecuteTaskAsync <SongRequestBlacklist>(_twitchBotApiLink + $"songrequestblacklists/delete/{broadcasterId}?artist={artist}&title={title}"));
 }
Example #5
0
 public async Task <List <BalanceResult> > UpdateCreateBalance(List <string> usernameList, int broadcasterId, int deposit, bool showOutput = false)
 {
     return(await ApiBotRequest.PutExecuteTaskAsync <List <BalanceResult> >(_twitchBotApiLink + $"banks/updatecreateaccount/{broadcasterId}?deposit={deposit}&showOutput={showOutput}", usernameList));
 }
        /// <summary>
        /// Load all of the settings from the database for the boss fight mini-game
        /// </summary>
        /// <param name="broadcasterId"></param>
        /// <param name="gameId"></param>
        /// <param name="twitchBotApiLink"></param>
        public async Task LoadSettings(int broadcasterId, int?gameId, string twitchBotApiLink)
        {
            BossFightClassStats bossFightClassStats = null;
            BossFightBossStats  bossFightBossStats  = null;

            BossFightSetting bossFightSetting = await ApiBotRequest.GetExecuteTaskAsync <BossFightSetting>(twitchBotApiLink + $"bossfightsettings/get/{broadcasterId}");

            if (bossFightSetting == null)
            {
                bossFightSetting = new BossFightSetting {
                    BroadcasterId = broadcasterId
                };
                bossFightSetting = await ApiBotRequest.PostExecuteTaskAsync(twitchBotApiLink + $"bossfightsettings/create", bossFightSetting);
            }

            if (bossFightSetting == null)
            {
                throw new Exception("Unable to create initial boss fight settings");
            }

            SettingsId = bossFightSetting.Id;

            bossFightClassStats = await ApiBotRequest.GetExecuteTaskAsync <BossFightClassStats>(twitchBotApiLink + $"bossfightclassstats/get/{SettingsId}");

            if (bossFightClassStats == null)
            {
                bossFightClassStats = new BossFightClassStats {
                    SettingsId = SettingsId
                };
                bossFightClassStats = await ApiBotRequest.PostExecuteTaskAsync(twitchBotApiLink + $"bossfightclassstats/create", bossFightClassStats);
            }

            if (bossFightClassStats == null)
            {
                throw new Exception("Unable to create boss fight class stats");
            }

            bossFightBossStats = await ApiBotRequest.GetExecuteTaskAsync <BossFightBossStats>(twitchBotApiLink + $"bossfightbossstats/get/{SettingsId}?gameId={gameId}");

            if (bossFightBossStats == null)
            {
                bossFightBossStats = new BossFightBossStats {
                    SettingsId = SettingsId
                };
                bossFightBossStats = await ApiBotRequest.PostExecuteTaskAsync(twitchBotApiLink + $"bossfightbossstats/create", bossFightBossStats);
            }

            if (bossFightBossStats == null)
            {
                throw new Exception("Unable to create boss fight boss stats");
            }

            // refresh arrays and lists
            NextLevelMessages = new string[4];
            Bosses            = new Boss[]
            {
                new Boss {
                },
                new Boss {
                },
                new Boss {
                },
                new Boss {
                },
                new Boss {
                }
            };
            ClassStats = new FighterClass[]
            {
                new FighterClass {
                },
                new FighterClass {
                },
                new FighterClass {
                },
                new FighterClass {
                },
                new FighterClass {
                }
            };
            Fighters = new BlockingCollection <BossFighter>();

            // entry messages and initial settings
            CooldownTimePeriodMinutes = bossFightSetting.CooldownPeriodMin;
            EntryPeriodSeconds        = bossFightSetting.EntryPeriodSec;
            EntryMessage  = bossFightSetting.EntryMessage;
            Cost          = bossFightSetting.Cost;
            CooldownEntry = bossFightSetting.CooldownEntry;
            CooldownOver  = bossFightSetting.CooldownOver;

            // next level messages
            NextLevelMessages[0] = bossFightSetting.NextLevelMessage2;
            NextLevelMessages[1] = bossFightSetting.NextLevelMessage3;
            NextLevelMessages[2] = bossFightSetting.NextLevelMessage4;
            NextLevelMessages[3] = bossFightSetting.NextLevelMessage5;

            // game outcomes
            GameStart         = bossFightSetting.GameStart;
            ResultsMessage    = bossFightSetting.ResultsMessage;
            SingleUserSuccess = bossFightSetting.SingleUserSuccess;
            SingleUserFail    = bossFightSetting.SingleUserFail;
            Success100        = bossFightSetting.Success100;
            Success34         = bossFightSetting.Success34;
            Success1          = bossFightSetting.Success1;
            Success0          = bossFightSetting.Success0;

            // fighter class stats
            ClassStats[0].ChatterType = ChatterType.Viewer;
            ClassStats[0].Attack      = bossFightClassStats.ViewerAttack;
            ClassStats[0].Defense     = bossFightClassStats.ViewerDefense;
            ClassStats[0].Evasion     = bossFightClassStats.ViewerEvasion;
            ClassStats[0].Health      = bossFightClassStats.ViewerHealth;
            ClassStats[1].ChatterType = ChatterType.Follower;
            ClassStats[1].Attack      = bossFightClassStats.FollowerAttack;
            ClassStats[1].Defense     = bossFightClassStats.FollowerDefense;
            ClassStats[1].Evasion     = bossFightClassStats.FollowerEvasion;
            ClassStats[1].Health      = bossFightClassStats.FollowerHealth;
            ClassStats[2].ChatterType = ChatterType.RegularFollower;
            ClassStats[2].Attack      = bossFightClassStats.RegularAttack;
            ClassStats[2].Defense     = bossFightClassStats.RegularDefense;
            ClassStats[2].Evasion     = bossFightClassStats.RegularEvasion;
            ClassStats[2].Health      = bossFightClassStats.RegularHealth;
            ClassStats[3].ChatterType = ChatterType.Moderator;
            ClassStats[3].Attack      = bossFightClassStats.ModeratorAttack;
            ClassStats[3].Defense     = bossFightClassStats.ModeratorDefense;
            ClassStats[3].Evasion     = bossFightClassStats.ModeratorEvasion;
            ClassStats[3].Health      = bossFightClassStats.ModeratorHealth;
            ClassStats[4].ChatterType = ChatterType.Subscriber;
            ClassStats[4].Attack      = bossFightClassStats.SubscriberAttack;
            ClassStats[4].Defense     = bossFightClassStats.SubscriberDefense;
            ClassStats[4].Evasion     = bossFightClassStats.SubscriberEvasion;
            ClassStats[4].Health      = bossFightClassStats.SubscriberHealth;

            // boss stats
            Bosses[0].Name            = bossFightBossStats.Name1;
            Bosses[0].MaxUsers        = bossFightBossStats.MaxUsers1;
            Bosses[0].Attack          = bossFightBossStats.Attack1;
            Bosses[0].Defense         = bossFightBossStats.Defense1;
            Bosses[0].Evasion         = bossFightBossStats.Evasion1;
            Bosses[0].Health          = bossFightBossStats.Health1;
            Bosses[0].TurnLimit       = bossFightBossStats.TurnLimit1;
            Bosses[0].Loot            = bossFightBossStats.Loot1;
            Bosses[0].LastAttackBonus = bossFightBossStats.LastAttackBonus1;
            Bosses[1].Name            = bossFightBossStats.Name2;
            Bosses[1].MaxUsers        = bossFightBossStats.MaxUsers2;
            Bosses[1].Attack          = bossFightBossStats.Attack2;
            Bosses[1].Defense         = bossFightBossStats.Defense2;
            Bosses[1].Evasion         = bossFightBossStats.Evasion2;
            Bosses[1].Health          = bossFightBossStats.Health2;
            Bosses[1].TurnLimit       = bossFightBossStats.TurnLimit2;
            Bosses[1].Loot            = bossFightBossStats.Loot2;
            Bosses[1].LastAttackBonus = bossFightBossStats.LastAttackBonus2;
            Bosses[2].Name            = bossFightBossStats.Name3;
            Bosses[2].MaxUsers        = bossFightBossStats.MaxUsers3;
            Bosses[2].Attack          = bossFightBossStats.Attack3;
            Bosses[2].Defense         = bossFightBossStats.Defense3;
            Bosses[2].Evasion         = bossFightBossStats.Evasion3;
            Bosses[2].Health          = bossFightBossStats.Health3;
            Bosses[2].TurnLimit       = bossFightBossStats.TurnLimit3;
            Bosses[2].Loot            = bossFightBossStats.Loot3;
            Bosses[2].LastAttackBonus = bossFightBossStats.LastAttackBonus3;
            Bosses[3].Name            = bossFightBossStats.Name4;
            Bosses[3].MaxUsers        = bossFightBossStats.MaxUsers4;
            Bosses[3].Attack          = bossFightBossStats.Attack4;
            Bosses[3].Defense         = bossFightBossStats.Defense4;
            Bosses[3].Evasion         = bossFightBossStats.Evasion4;
            Bosses[3].Health          = bossFightBossStats.Health4;
            Bosses[3].TurnLimit       = bossFightBossStats.TurnLimit4;
            Bosses[3].Loot            = bossFightBossStats.Loot4;
            Bosses[3].LastAttackBonus = bossFightBossStats.LastAttackBonus4;
            Bosses[4].Name            = bossFightBossStats.Name5;
            Bosses[4].MaxUsers        = bossFightBossStats.MaxUsers5;
            Bosses[4].Attack          = bossFightBossStats.Attack5;
            Bosses[4].Defense         = bossFightBossStats.Defense5;
            Bosses[4].Evasion         = bossFightBossStats.Evasion5;
            Bosses[4].Health          = bossFightBossStats.Health5;
            Bosses[4].TurnLimit       = bossFightBossStats.TurnLimit5;
            Bosses[4].Loot            = bossFightBossStats.Loot5;
            Bosses[4].LastAttackBonus = bossFightBossStats.LastAttackBonus5;
        }
 public async Task <SongRequest> PopSongRequest(int broadcasterId)
 {
     return(await ApiBotRequest.DeleteExecuteTaskAsync <SongRequest>(_twitchBotApiLink + $"songrequests/delete/{broadcasterId}?popone=true"));
 }
Example #8
0
 public async Task <List <Quote> > GetQuotes(int broadcasterId)
 {
     return(await ApiBotRequest.GetExecuteAsync <List <Quote> >(_twitchBotApiLink + $"quotes/get/{broadcasterId}"));
 }
        public async Task <int> CurrentExp(string chatter, int broadcasterId)
        {
            RankFollower follower = await ApiBotRequest.GetExecuteTaskAsync <RankFollower>(_twitchBotApiLink + $"rankfollowers/get/{broadcasterId}?username={chatter}");

            return(follower.Experience);
        }
        public async Task DeleteModerator(string twitchBotApiLink, int broadcasterId, string username)
        {
            BotModerator botModerator = await ApiBotRequest.DeleteExecuteAsync <BotModerator>(twitchBotApiLink + $"botmoderators/delete/{broadcasterId}?username={username}");

            _botModerators.Remove(botModerator);
        }
 public async Task <TwitchGameCategory> GetGameId(string gameTitle)
 {
     return(await ApiBotRequest.GetExecuteTaskAsync <TwitchGameCategory>(_twitchBotApiLink + $"twitchgamecategories/get?title={gameTitle}"));
 }
        public async Task AddModerator(string twitchBotApiLink, BotModerator botModerator)
        {
            await ApiBotRequest.PostExecuteAsync(twitchBotApiLink + $"botmoderators/create", botModerator);

            _botModerators.Add(botModerator);
        }
 public async Task LoadExistingModerators(string twitchBotApiLink, int broadcasterId)
 {
     _botModerators = await ApiBotRequest.GetExecuteAsync <List <BotModerator> >(twitchBotApiLink + $"botmoderators/get/{broadcasterId}");
 }
 public async Task <InGameUsername> DeleteInGameUsername(int id, int broadcasterId)
 {
     return(await ApiBotRequest.DeleteExecuteTaskAsync <InGameUsername>(_twitchBotApiLink + $"ingameusernames/delete/{broadcasterId}?id={id}"));
 }
 public async Task <List <SongRequestIgnore> > AllowArtist(string artist, int broadcasterId)
 {
     return(await ApiBotRequest.DeleteExecuteTaskAsync <List <SongRequestIgnore> >(_twitchBotApiLink + $"songrequestignores/delete/{broadcasterId}?artist={artist}"));
 }
 public async Task UpdateExp(string chatter, int broadcasterId, int exp)
 {
     await ApiBotRequest.PutExecuteTaskAsync <RankFollower>(_twitchBotApiLink + $"rankfollowers/updateexp/{broadcasterId}?username={chatter}&exp={exp}");
 }
 public async Task <SongRequestIgnore> AllowSong(string title, string artist, int broadcasterId)
 {
     return(await ApiBotRequest.DeleteExecuteTaskAsync <SongRequestIgnore>(_twitchBotApiLink + $"songrequestignores/delete/{broadcasterId}?artist={artist}&title={title}"));
 }
 public async Task <List <Rank> > GetRankList(int broadcasterId)
 {
     return(await ApiBotRequest.GetExecuteTaskAsync <List <Rank> >(_twitchBotApiLink + $"ranks/get/{broadcasterId}"));
 }
 public async Task <List <SongRequest> > ListSongRequests(int broadcasterId)
 {
     return(await ApiBotRequest.GetExecuteTaskAsync <List <SongRequest> >(_twitchBotApiLink + $"songrequests/get/{broadcasterId}"));
 }
 public async Task <IEnumerable <RankFollower> > GetFollowersLeaderboard(string broadcasterName, int broadcasterId, string botName)
 {
     return(await ApiBotRequest.GetExecuteTaskAsync <List <RankFollower> >(_twitchBotApiLink + $"rankfollowers/getleaderboard/{broadcasterId}?topnumber=3"));
 }
Example #21
0
 public async Task <List <SongRequestBlacklist> > DeleteArtistFromBlacklist(string artist, int broadcasterId)
 {
     return(await ApiBotRequest.DeleteExecuteTaskAsync <List <SongRequestBlacklist> >(_twitchBotApiLink + $"songrequestblacklists/delete/{broadcasterId}?artist={artist}"));
 }
Example #22
0
 public async Task <PartyUp> GetPartyMember(string partyMember, int gameId, int broadcasterId)
 {
     return(await ApiBotRequest.GetExecuteTaskAsync <PartyUp>(_twitchBotApiLink + $"partyups/get/{broadcasterId}?gameId={gameId}&partymember={partyMember}"));
 }
Example #23
0
 public async Task <List <SongRequestBlacklist> > ResetBlacklist(int broadcasterId)
 {
     return(await ApiBotRequest.DeleteExecuteTaskAsync <List <SongRequestBlacklist> >(_twitchBotApiLink + $"songrequestblacklists/delete/{broadcasterId}"));
 }
Example #24
0
 public async Task <List <string> > GetPartyList(int gameId, int broadcasterId)
 {
     return(await ApiBotRequest.GetExecuteTaskAsync <List <string> >(_twitchBotApiLink + $"partyups/get/{broadcasterId}?gameId={gameId}"));
 }
Example #25
0
 public async Task UpdateAccount(string walletOwner, int broadcasterId, int newWalletBalance)
 {
     await ApiBotRequest.PutExecuteTaskAsync <Bank>(_twitchBotApiLink + $"banks/updateaccount/{broadcasterId}?updatedwallet={newWalletBalance}&username={walletOwner}");
 }
 public async Task <InGameUsername> GetInGameUsername(int?gameId, int broadcasterId)
 {
     return(await ApiBotRequest.GetExecuteTaskAsync <InGameUsername>(_twitchBotApiLink + $"ingameusernames/get/{broadcasterId}?gameid={gameId}"));
 }