1
0
DiscordMediaRichPresence/DiscordMediaRP/Program.cs

12 lines
570 B
C#
Raw Normal View History

2024-02-22 02:46:19 +01:00
// See https://aka.ms/new-console-template for more information
using DiscordMediaRP;
using Microsoft.Extensions.Logging;
int loglevelIndex = Array.IndexOf(args, "-l") + 1;
LogLevel? level = loglevelIndex >= 0 && loglevelIndex < args.Length ? Enum.Parse<LogLevel>(args[loglevelIndex]) : null;
int discordKeyIndex = Array.IndexOf(args, "-d") + 1;
if (discordKeyIndex < 1 || discordKeyIndex >= args.Length)
throw new IndexOutOfRangeException("No Discord ApplicationKey provided");
string discordKey = args[discordKeyIndex];
DisMediaRP _ = new (discordKey, level);