Esempio n. 1
0
        public static IChannelServices GetChannelServices()
        {
            AzureStorageSettings azureStorageSettings = new()
            {
                AccountKey  = Environment.GetEnvironmentVariable("Storage_AccountKey"),
                AccountName = Environment.GetEnvironmentVariable("Storage_AccountName"),
                Url         = Environment.GetEnvironmentVariable("Storage_Url")
            };

            TwitchAPI twitchAPI = new();

            twitchAPI.Settings.ClientId    = Environment.GetEnvironmentVariable("TwitchHostingManager_ClientId");
            twitchAPI.Settings.AccessToken = Environment.GetEnvironmentVariable("TwitchHostingManager_AccessToken");

            return(new ChannelServices(AzureStorageHelper.GetTableClient(azureStorageSettings, "channels"), twitchAPI));
        }
    }
        static async Task Main()
        {
            AzureStorageSettings azureStorageSettings = new()
            {
                AccountKey  = Settings.AccountKey,
                AccountName = Settings.AccountName,
                Url         = Settings.Url
            };

            TwitchAPI twitchAPI = new();

            twitchAPI.Settings.ClientId    = Environment.GetEnvironmentVariable("TwitchHostingManager_ClientId");
            twitchAPI.Settings.AccessToken = Environment.GetEnvironmentVariable("TwitchHostingManager_AccessToken");


            IChannelServices channelServices = new ChannelServices(AzureStorageHelper.GetTableClient(azureStorageSettings, "channels"), twitchAPI);

            //await GetChannelTeams(channelServices);
            //await IsChannelBroadcasting(channelServices);
            //await GetChannelStatus("tlcoperator");

            //HostChannel(channelServices);
            //Console.WriteLine("Hosted channel");
            //Console.ReadLine();

            //TwitchBot twitchBot = new("thelegomaestro");
            ////Console.WriteLine("Hit enter to send message");
            ////Console.ReadLine();
            //twitchBot.SendMessage("Does this work now?");
            ////Console.ReadLine();
            ////Console.WriteLine("Done");

            //await AddChannelAsync(channelServices);

            await GetChannelStatus(channelServices);

            //await AddChannelAsync(channelServices);

            //GetChannels(channelServices);
        }