Remvoed secrets for Twitch since they don't work

This commit is contained in:
Martin Barker
2023-01-28 02:13:17 +00:00
parent 36ad4fff02
commit b09eb0a641
4 changed files with 40 additions and 34 deletions

View File

@@ -1,6 +1,4 @@
using ABI.System;
using Microsoft.Extensions.Configuration;
using System.Diagnostics;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Text;
@@ -14,9 +12,8 @@ namespace TwitchDesktopNotifications.Core
internal class TwitchFetcher
{
private TwitchFetcher() {
var config = new ConfigurationBuilder().AddUserSecrets<Program>().Build();
TwitchClientID = config["TwitchClientID"];
TwitchClientSecret = config["TwitchClientSecret"];
TwitchClientID = "";
TwitchClientSecret = "";
}
public static TwitchFetcher instance { get; private set; }

View File

@@ -40,6 +40,10 @@ namespace TwitchDesktopNotifications
String FileName = "store.json";
string fileContent = JsonSerializer.Serialize<JsonStructure.Store>(Store);
Console.WriteLine("I'm trying to save:");
Console.WriteLine(fileContent);
Console.WriteLine("to {0}", FilePath + "/" + FileName);
Directory.CreateDirectory(FilePath);
File.WriteAllText(FilePath + "/" + FileName, fileContent);
}

View File

@@ -1,5 +1,6 @@
// See https://aka.ms/new-console-template for more information
using System.Drawing;
using System.Reflection.Metadata;
using System.Runtime.InteropServices;
using System.Text.Json;
using System.Windows.Controls;
@@ -18,7 +19,6 @@ internal class Program
private static NotifyIcon notifyIcon;
private static ContextMenuStrip cms;
public static void Ws_CodeRecived(object? sender, EventArgs e)
{
ws.CodeRecived -= Ws_CodeRecived;
@@ -74,36 +74,42 @@ internal class Program
private static async Task Main(string[] args)
{
var timer = new PeriodicTimer(TimeSpan.FromSeconds(10));
notifyIcon = new NotifyIcon();
notifyIcon.Icon = new Icon("Assets/icon.ico");
notifyIcon.Text = "Notify";
cms = new ContextMenuStrip();
cms.Items.Add(new ToolStripMenuItem("Reconnect", null, new EventHandler(Reconnect_Click)));
cms.Items.Add(new ToolStripSeparator());
cms.Items.Add(new ToolStripMenuItem("Quit", null, new EventHandler(Quit_Click), "Quit"));
notifyIcon.ContextMenuStrip = cms;
notifyIcon.Visible = true;
if (DataStore.GetInstance().Store.Authentication == null)
try
{
TriggerAuthentication();
}
var timer = new PeriodicTimer(TimeSpan.FromSeconds(10));
new Thread(() =>
{
while (true)
notifyIcon = new NotifyIcon();
notifyIcon.Icon = new Icon("Assets/icon.ico");
notifyIcon.Text = "Twitch Notify";
cms = new ContextMenuStrip();
cms.Items.Add(new ToolStripMenuItem("Reconnect", null, new EventHandler(Reconnect_Click)));
cms.Items.Add(new ToolStripSeparator());
cms.Items.Add(new ToolStripMenuItem("Quit", null, new EventHandler(Quit_Click), "Quit"));
notifyIcon.ContextMenuStrip = cms;
notifyIcon.Visible = true;
if (DataStore.GetInstance().Store.Authentication == null)
{
Thread.Sleep(10000);
TwitchFetcher.GetInstance().GetLiveFollowingUsers();
TriggerAuthentication();
}
}).Start();
Application.Run();
new Thread(() =>
{
while (true)
{
Thread.Sleep(10000);
TwitchFetcher.GetInstance().GetLiveFollowingUsers();
}
}).Start();
Application.Run();
}
catch (Exception e) {
Console.WriteLine(e.ToString());
}
}
}

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0-windows10.0.17763.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
@@ -19,7 +19,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" />
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="8.0.0-build.65" />
</ItemGroup>