mirror of
https://github.com/Stone-Red-Code/DiscordCLI.git
synced 2026-09-04 09:05:59 +02:00
Updated file structure
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.31019.35
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscordCLI", "DiscordCLI\DiscordCLI.csproj", "{24B958A5-5485-4028-AE10-253105918CBD}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{24B958A5-5485-4028-AE10-253105918CBD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{24B958A5-5485-4028-AE10-253105918CBD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{24B958A5-5485-4028-AE10-253105918CBD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{24B958A5-5485-4028-AE10-253105918CBD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {E73EF9D5-29ED-4906-88C0-118F2A025B6A}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,232 @@
|
||||
using DSharpPlus.Entities;
|
||||
using DSharpPlus;
|
||||
using Stone_Red_Utilities.ColorConsole;
|
||||
using Stone_Red_Utilities.StringExtentions;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DiscordCLI
|
||||
{
|
||||
internal class Commands
|
||||
{
|
||||
private readonly DiscordClient client;
|
||||
|
||||
private readonly OutputManager outputManager;
|
||||
|
||||
public Commands(DiscordClient dicordClient, OutputManager outputMan)
|
||||
{
|
||||
client = dicordClient;
|
||||
outputManager = outputMan;
|
||||
}
|
||||
|
||||
protected async Task ListGuilds(string args)
|
||||
{
|
||||
int index = 1;
|
||||
foreach (DiscordGuild guild in client.Guilds.Values)
|
||||
{
|
||||
Console.WriteLine($"{index}. {guild.Name}");
|
||||
index++;
|
||||
}
|
||||
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
protected async Task ListDms(string args)
|
||||
{
|
||||
int index = 1;
|
||||
foreach (DiscordDmChannel dmChannel in client.PrivateChannels)
|
||||
{
|
||||
Console.WriteLine($"{index}. {string.Join(", ", dmChannel.Recipients.Select(x => x.Username))}");
|
||||
index++;
|
||||
}
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
protected async Task ListGuildChannels(string args)
|
||||
{
|
||||
IReadOnlyCollection<DiscordChannel> textChannels;
|
||||
DiscordGuild guild;
|
||||
|
||||
if (args != null)
|
||||
{
|
||||
if (int.TryParse(args, out int ind))
|
||||
{
|
||||
guild = client.Guilds?.Values.ElementAtOrDefault(ind - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
guild = client.Guilds?.FirstOrDefault(x => x.Value.Name == args).Value;
|
||||
}
|
||||
GlobalInformation.currentTextChannel = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
guild = GlobalInformation.currentGuild;
|
||||
}
|
||||
|
||||
if (guild is null)
|
||||
{
|
||||
ConsoleExt.WriteLine("Guild not found!", ConsoleColor.Red);
|
||||
GlobalInformation.currentTextChannel = null;
|
||||
return;
|
||||
}
|
||||
|
||||
GlobalInformation.currentGuild = guild;
|
||||
textChannels = guild.Channels;
|
||||
|
||||
int index = 1;
|
||||
foreach (DiscordChannel channel in textChannels)
|
||||
{
|
||||
switch (channel.Type)
|
||||
{
|
||||
case ChannelType.Category:
|
||||
//Console.WriteLine($"[{channel.Name}]");
|
||||
break;
|
||||
|
||||
case ChannelType.Text:
|
||||
Console.WriteLine($"{index}. {channel.Name}");
|
||||
index++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
protected async Task EnterChannel(string args)
|
||||
{
|
||||
DiscordChannel textChannel;
|
||||
|
||||
if (GlobalInformation.currentGuild is null)
|
||||
{
|
||||
ConsoleExt.WriteLine("You are not in a guild!", ConsoleColor.Red);
|
||||
return;
|
||||
}
|
||||
|
||||
if (int.TryParse(args, out int ind))
|
||||
{
|
||||
textChannel = GlobalInformation.currentGuild?.Channels.Where(x => x.Type == ChannelType.Text).ElementAtOrDefault(ind - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
textChannel = GlobalInformation.currentGuild?.Channels.Where(x => x.Type == ChannelType.Text).FirstOrDefault(x => x.Name == args);
|
||||
}
|
||||
|
||||
GlobalInformation.currentTextChannel = textChannel;
|
||||
|
||||
if (textChannel is null)
|
||||
{
|
||||
ConsoleExt.WriteLine("Channel not found!", ConsoleColor.Red);
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
foreach (DiscordMessage message in (textChannel.GetMessagesAsync(10).Result).Reverse())
|
||||
{
|
||||
await outputManager.WriteMessage(message, textChannel, GlobalInformation.currentGuild, false);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ConsoleExt.WriteLine(ex.Message, ConsoleColor.Red);
|
||||
GlobalInformation.currentTextChannel = null;
|
||||
}
|
||||
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
protected async Task EnterDmChannel(string args)
|
||||
{
|
||||
DiscordDmChannel dmChannel;
|
||||
|
||||
GlobalInformation.currentGuild = null;
|
||||
|
||||
if (int.TryParse(args, out int ind))
|
||||
{
|
||||
dmChannel = client.PrivateChannels.ElementAtOrDefault(ind - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
dmChannel = client.PrivateChannels.FirstOrDefault(x => x.Name == args);
|
||||
}
|
||||
|
||||
GlobalInformation.currentTextChannel = dmChannel;
|
||||
|
||||
if (dmChannel is null)
|
||||
{
|
||||
ConsoleExt.WriteLine("Channel not found!", ConsoleColor.Red);
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
foreach (DiscordMessage message in (await dmChannel.GetMessagesAsync(10)).Reverse())
|
||||
{
|
||||
await outputManager.WriteMessage(message, dmChannel, GlobalInformation.currentGuild, false);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ConsoleExt.WriteLine(ex, ConsoleColor.Red);
|
||||
GlobalInformation.currentTextChannel = null;
|
||||
}
|
||||
}
|
||||
|
||||
protected async Task DeleteToken(string args)
|
||||
{
|
||||
File.Delete(Program.tokenPath);
|
||||
Environment.Exit(0);
|
||||
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
protected async Task UserInfo(string userName)
|
||||
{
|
||||
if (GlobalInformation.currentGuild is null)
|
||||
{
|
||||
ConsoleExt.WriteLine("You are not in a guild!", ConsoleColor.Red);
|
||||
return;
|
||||
}
|
||||
|
||||
if (userName is null)
|
||||
{
|
||||
ConsoleExt.WriteLine("User not found!", ConsoleColor.Red);
|
||||
return;
|
||||
}
|
||||
|
||||
DiscordUser discordUser = GlobalInformation.currentGuild?.Members?.FirstOrDefault(user => user.Username.EqualsIgnoreSpacesAndCase(userName));
|
||||
|
||||
if (discordUser is null)
|
||||
{
|
||||
discordUser = GlobalInformation.currentGuild?.Members?.FirstOrDefault(user => $"{user.Username}#{user.Discriminator}".EqualsIgnoreSpacesAndCase(userName));
|
||||
}
|
||||
|
||||
if (discordUser is null)
|
||||
{
|
||||
discordUser = GlobalInformation.currentGuild?.Members?.FirstOrDefault(user => $"{user.Nickname}".EqualsIgnoreSpacesAndCase(userName));
|
||||
}
|
||||
|
||||
if (discordUser is not null)
|
||||
{
|
||||
string infoString =
|
||||
$"Username: {discordUser.Username}#{discordUser.Discriminator}" + Environment.NewLine +
|
||||
$"Status: {discordUser.Presence?.Status}" + Environment.NewLine +
|
||||
$"Created at: {discordUser.CreationTimestamp}" + Environment.NewLine +
|
||||
$"ID: {discordUser.Id}" + Environment.NewLine +
|
||||
$"Bot: {discordUser.IsBot}";
|
||||
Console.WriteLine(infoString);
|
||||
}
|
||||
else
|
||||
{
|
||||
ConsoleExt.WriteLine("User not found!", ConsoleColor.Red);
|
||||
}
|
||||
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
using DSharpPlus;
|
||||
using Stone_Red_Utilities.ColorConsole;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System;
|
||||
using System.Timers;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DiscordCLI
|
||||
{
|
||||
internal class CommandsManager : Commands
|
||||
{
|
||||
private readonly DiscordClient client;
|
||||
|
||||
private readonly Dictionary<string, (string, Func<string, Task>)> CommandsList;
|
||||
private int cooldown = 0;
|
||||
|
||||
public CommandsManager(DiscordClient dicordClient, OutputManager outputManager) : base(dicordClient, outputManager)
|
||||
{
|
||||
client = dicordClient;
|
||||
|
||||
CommandsList = new()
|
||||
{
|
||||
{ "exit", ("exits application", null) },
|
||||
{ "logout", ("deletes auth token and exits application", DeleteToken) },
|
||||
{ "guilds", ("lists all guilds you are in", ListGuilds) },
|
||||
{ "dms", ("lists all private channels", ListDms) },
|
||||
{ "channels", ("lists all channels of guild args:<guild name/index>", ListGuildChannels) },
|
||||
{ "enterg", ("enter guild args:<guild name/index>", ListGuildChannels) },
|
||||
{ "enterc", ("enter channel args:<channel name/index>", EnterChannel) },
|
||||
{ "enterd", ("enter DM channel args:<channel name/index>", EnterDmChannel) },
|
||||
{ "userinfo", ("gets information about a user:<user name>", UserInfo) },
|
||||
};
|
||||
|
||||
Timer cooldownTimer = new Timer(1000);
|
||||
cooldownTimer.Elapsed += CooldownTimer_Elapsed;
|
||||
cooldownTimer.Start();
|
||||
}
|
||||
|
||||
private void CooldownTimer_Elapsed(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
if (cooldown > 0)
|
||||
cooldown--;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check the command and return true if the program should exit
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns>exit bool and write override bool</returns>
|
||||
public async Task<(bool, bool)> CheckCommand(string rawInput)
|
||||
{
|
||||
cooldown++;
|
||||
|
||||
if (cooldown > 1)
|
||||
{
|
||||
Console.WriteLine();
|
||||
ConsoleExt.WriteLine("You are beeing rate limited!", ConsoleColor.Yellow);
|
||||
ConsoleExt.WriteLine("Wait a few seconds before making another request!", ConsoleColor.Yellow);
|
||||
return (false, true);
|
||||
}
|
||||
|
||||
string input = rawInput.Trim().ToLower().Replace('\n', '\0');
|
||||
|
||||
if (string.IsNullOrWhiteSpace(input))
|
||||
return (false, false);
|
||||
|
||||
if (input.StartsWith(InputManager.prefix))
|
||||
{
|
||||
input = input.Remove(0, 1);
|
||||
}
|
||||
else if (GlobalInformation.currentTextChannel != null)
|
||||
{
|
||||
cooldown++;
|
||||
Console.Write("\r" + new string(' ', Console.WindowWidth));
|
||||
await GlobalInformation.currentTextChannel.SendMessageAsync(rawInput);
|
||||
return (false, false);
|
||||
}
|
||||
|
||||
Console.WriteLine();
|
||||
|
||||
if (input == "exit" || input is null)
|
||||
return (true, false);
|
||||
|
||||
string args = input.Contains(" ") ? input[input.IndexOf(" ")..].Trim() : null;
|
||||
input = input.Contains(" ") ? input.Substring(0, input.IndexOf(" ")) : input;
|
||||
|
||||
if (input == "help" || input == "?")
|
||||
{
|
||||
Console.WriteLine($"Prefix: '{InputManager.prefix}' (Only required in text channels)");
|
||||
Console.WriteLine();
|
||||
|
||||
for (int i = 0; i < CommandsList.Count; i++)
|
||||
{
|
||||
Console.Write($"{i + 1}. {CommandsList.Keys.ElementAt(i)}".PadRight(15));
|
||||
Console.WriteLine(CommandsList.Values.ElementAt(i).Item1);
|
||||
}
|
||||
}
|
||||
else if (CommandsList.ContainsKey(input))
|
||||
{
|
||||
await CommandsList[input].Item2(args);
|
||||
}
|
||||
else
|
||||
{
|
||||
ConsoleExt.WriteLine("Command does not exist!", ConsoleColor.Red);
|
||||
}
|
||||
return (false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ColorMineStandard" Version="1.0.0" />
|
||||
<PackageReference Include="DSharpPlus" Version="3.2.3" />
|
||||
<PackageReference Include="Stone_Red-C-Sharp-Utilities" Version="1.0.0.2" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<_LastSelectedProfileId>C:\Users\David\Google Drive\Programmieren\DiscordCLI\DiscordCLI\Properties\PublishProfiles\Windows.pubxml</_LastSelectedProfileId>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,10 @@
|
||||
using DSharpPlus.Entities;
|
||||
|
||||
namespace DiscordCLI
|
||||
{
|
||||
internal static class GlobalInformation
|
||||
{
|
||||
public static DiscordGuild currentGuild;
|
||||
public static DiscordChannel currentTextChannel;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
using DSharpPlus;
|
||||
using System.Threading.Tasks;
|
||||
using System;
|
||||
using DSharpPlus.Entities;
|
||||
using System.Linq;
|
||||
|
||||
namespace DiscordCLI
|
||||
{
|
||||
internal class InputManager
|
||||
{
|
||||
private readonly CommandsManager commandsManager;
|
||||
private readonly DiscordClient client;
|
||||
public const string prefix = ">";
|
||||
public string Input { get; private set; } = string.Empty;
|
||||
|
||||
public InputManager(DiscordClient dicordClient, CommandsManager commandsMan)
|
||||
{
|
||||
client = dicordClient;
|
||||
commandsManager = commandsMan;
|
||||
}
|
||||
|
||||
public async Task ReadInput()
|
||||
{
|
||||
bool exit = false;
|
||||
bool printOverride = false;
|
||||
string lastInput = prefix;
|
||||
while (!exit)
|
||||
{
|
||||
DiscordDmChannel dmChannel = GlobalInformation.currentTextChannel as DiscordDmChannel;
|
||||
string infoString = $"\r[{client.CurrentUser.Username}#{client.CurrentUser.Discriminator}] [{(dmChannel is null ? GlobalInformation.currentGuild?.Name : "DMs")}/{(dmChannel is null ? GlobalInformation.currentTextChannel?.Name : string.Join(", ", dmChannel.Recipients.Select(x => x.Username)))}] ==> ";
|
||||
if (lastInput.StartsWith(prefix) || printOverride)
|
||||
Console.Write(Environment.NewLine + infoString);
|
||||
|
||||
printOverride = false;
|
||||
|
||||
ConsoleKeyInfo keyInfo;
|
||||
do
|
||||
{
|
||||
keyInfo = Console.ReadKey(true);
|
||||
if (!char.IsControl(keyInfo.KeyChar))
|
||||
Input += keyInfo.KeyChar.ToString();
|
||||
|
||||
if (keyInfo.Key == ConsoleKey.Backspace && Input.Length > 0)
|
||||
{
|
||||
Input = Input.Remove(Input.Length - 1);
|
||||
}
|
||||
|
||||
Console.Write(keyInfo.KeyChar);
|
||||
if (keyInfo.Key == ConsoleKey.Backspace)
|
||||
Console.Write(" ");
|
||||
|
||||
Console.CursorLeft = infoString.Length + Input.Length - 1;
|
||||
} while (keyInfo.Key != ConsoleKey.Enter);
|
||||
|
||||
if (GlobalInformation.currentTextChannel == null && !Input.StartsWith(prefix))
|
||||
Input = prefix + Input;
|
||||
|
||||
lastInput = new string(Input);
|
||||
Input = string.Empty;
|
||||
|
||||
(exit, printOverride) = await commandsManager.CheckCommand(lastInput);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,236 @@
|
||||
using ColorMine.ColorSpaces.Comparisons;
|
||||
using ColorMine.ColorSpaces;
|
||||
using DSharpPlus.Entities;
|
||||
using DSharpPlus;
|
||||
using Stone_Red_Utilities.ColorConsole;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace DiscordCLI
|
||||
{
|
||||
internal class OutputManager
|
||||
{
|
||||
private readonly DiscordClient client;
|
||||
public InputManager InputManager { get; set; }
|
||||
|
||||
public OutputManager(DiscordClient discordClient)
|
||||
{
|
||||
client = discordClient;
|
||||
}
|
||||
|
||||
public async Task WriteMessage(DiscordMessage message, DiscordChannel channel, DiscordGuild guild, bool writeInfo = true)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (channel.Id != GlobalInformation.currentTextChannel?.Id)
|
||||
return;
|
||||
|
||||
DiscordUser user = message.Author;
|
||||
|
||||
if (GlobalInformation.currentGuild is not null)
|
||||
{
|
||||
DiscordMember discordMember = await guild.GetMemberAsync(user.Id);
|
||||
DiscordColor discordColor = discordMember.Color;
|
||||
Color color = Color.FromArgb(discordColor.R, discordColor.G, discordColor.B);
|
||||
|
||||
WriteTop($"[{discordMember.DisplayName}]", color, message, true, true, $"{discordMember.Username}#{discordMember.Discriminator} {message.Timestamp.LocalDateTime}");
|
||||
}
|
||||
else
|
||||
{
|
||||
WriteTop($"[{user.Username}]", Color.White, message, true, true, $"{user.Username}#{user.Discriminator} {message.Timestamp.LocalDateTime}");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(message.Content))
|
||||
WriteTop(message.Content, Color.White, message);
|
||||
|
||||
foreach (DiscordAttachment attachment in message.Attachments)
|
||||
{
|
||||
WriteTop($"{attachment.Url}", Color.White, message, true, true, attachment.FileName);
|
||||
}
|
||||
|
||||
foreach (DiscordEmbed embed in message.Embeds)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(embed.Title))
|
||||
{
|
||||
WriteTop(">>> ", Color.FromArgb(embed.Color.Value), message, true, false);
|
||||
WriteTop($"{{{embed.Title}}}", Color.White, message, false);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(embed.Description))
|
||||
{
|
||||
WriteTop(">>> ", Color.FromArgb(embed.Color.Value), message, true, false);
|
||||
WriteTop($"{embed.Description}", Color.White, message, false);
|
||||
}
|
||||
|
||||
if (embed.Fields is not null)
|
||||
{
|
||||
foreach (DiscordEmbedField field in embed.Fields)
|
||||
{
|
||||
WriteTop(">>> ", Color.FromArgb(embed.Color.Value), message, true, false);
|
||||
WriteTop($"{field.Name}{Environment.NewLine}{field.Value}", Color.White, message, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine(ex);
|
||||
}
|
||||
|
||||
WriteTop(string.Empty, Color.White, message);
|
||||
DiscordDmChannel dmChannel = GlobalInformation.currentTextChannel as DiscordDmChannel;
|
||||
|
||||
if (writeInfo)
|
||||
{
|
||||
string infoString = $"\r[{client.CurrentUser.Username}#{client.CurrentUser.Discriminator}] [{(dmChannel is null ? GlobalInformation.currentGuild?.Name : "DMs")}/{(dmChannel is null ? GlobalInformation.currentTextChannel?.Name : string.Join(", ", dmChannel.Recipients.Select(x => x.Username)))}] ==> ";
|
||||
Console.Write(infoString);
|
||||
Console.Write(InputManager.Input);
|
||||
}
|
||||
}
|
||||
|
||||
private void WriteTop(string message, Color color, DiscordMessage discordMessage, bool removeText = true, bool newLine = true, string info = null)
|
||||
{
|
||||
ConsoleColor consoleColor = ClosestConsoleColor(color);
|
||||
|
||||
if (consoleColor == Console.BackgroundColor || consoleColor == ConsoleColor.DarkGray)
|
||||
consoleColor = ConsoleColor.White;
|
||||
|
||||
if (removeText)
|
||||
Console.Write('\r' + new string(' ', Console.WindowWidth) + '\r');
|
||||
|
||||
List<string> words = message.Replace("\n", " %<newLine>%").Split(' ').ToList();
|
||||
for (int i = 0; i < words.Count; i++)
|
||||
{
|
||||
ConsoleColor mentionColor = ConsoleColor.Black;
|
||||
|
||||
if (IsUri(words[i]))
|
||||
{
|
||||
mentionColor = ConsoleColor.DarkCyan;
|
||||
}
|
||||
|
||||
if (words[i].Contains("<") && words[i].Contains(">") && !(words[i].StartsWith("<") && words[i].EndsWith(">")))
|
||||
{
|
||||
int index1 = words[i].IndexOf("<");
|
||||
int index2 = words[i].IndexOf(">");
|
||||
if (index1 < index2)
|
||||
{
|
||||
string part1 = words[i].Substring(0, index1);
|
||||
string part2 = words[i].Substring(index1, index2 - index1 + 1);
|
||||
string part3 = words[i].Substring(index2 + 1, words[i].Length - index2 - 1);
|
||||
|
||||
Debug.WriteLine(words[i] + "/" + i);
|
||||
Debug.WriteLine(part1 + "/" + part2 + "/" + part3);
|
||||
words[i] = part2;
|
||||
if (!string.IsNullOrEmpty(part1))
|
||||
{
|
||||
words.Insert(i, part1);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(part3))
|
||||
{
|
||||
words.Insert(i + (string.IsNullOrEmpty(part1) ? 1 : 2), part3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (DiscordUser user in discordMessage.MentionedUsers)
|
||||
{
|
||||
if (user?.Mention is not null)
|
||||
{
|
||||
if (words[i].Contains(user.Mention))
|
||||
{
|
||||
words[i] = words[i].Replace(user.Mention, $"@{user.Username}#{user.Discriminator}");
|
||||
mentionColor = ConsoleColor.Blue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (words[i].Contains("<@") && words[i].Contains('>'))
|
||||
{
|
||||
if (ulong.TryParse(words[i].Replace("!", string.Empty).Replace("<@", string.Empty).Replace(">", string.Empty), out ulong id))
|
||||
{
|
||||
DiscordUser discordUser = client.GetUserAsync(id).Result;
|
||||
Console.WriteLine(discordUser is null);
|
||||
|
||||
words[i] = words[i].Replace("<@!", "<@").Replace(discordUser.Mention, $"@{discordUser.Username}#{discordUser.Discriminator}");
|
||||
mentionColor = ConsoleColor.Blue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!discordMessage.Channel.IsPrivate)
|
||||
foreach (DiscordChannel channel in discordMessage.MentionedChannels)
|
||||
{
|
||||
if (channel?.Mention is not null)
|
||||
if (words[i].Contains(channel.Mention))
|
||||
{
|
||||
words[i] = words[i].Replace(channel.Mention, $"#{channel.Name}");
|
||||
mentionColor = ConsoleColor.Blue;
|
||||
}
|
||||
}
|
||||
|
||||
if (!discordMessage.Channel.IsPrivate)
|
||||
foreach (DiscordRole role in discordMessage.MentionedRoles)
|
||||
{
|
||||
if (role?.Mention is not null)
|
||||
if (words[i].Contains(role.Mention))
|
||||
{
|
||||
words[i] = words[i].Replace(role.Mention, $"@{role.Name}");
|
||||
DiscordColor discordColor = role.Color;
|
||||
mentionColor = ClosestConsoleColor(Color.FromArgb(discordColor.R, discordColor.G, discordColor.B));
|
||||
}
|
||||
}
|
||||
|
||||
ConsoleExt.Write(words[i].Replace("%<newLine>%", "\n") + " ", mentionColor == ConsoleColor.Black ? consoleColor : mentionColor);
|
||||
}
|
||||
|
||||
ConsoleExt.Write(info, ConsoleColor.DarkGray);
|
||||
|
||||
if (newLine)
|
||||
Console.WriteLine();
|
||||
}
|
||||
|
||||
private bool IsUri(string input)
|
||||
{
|
||||
return Uri.TryCreate(input, UriKind.Absolute, out Uri uriResult) && (uriResult.Scheme == Uri.UriSchemeHttp || uriResult.Scheme == Uri.UriSchemeHttps);
|
||||
}
|
||||
|
||||
private ConsoleColor ClosestConsoleColor(Color targetColor)
|
||||
{
|
||||
double minDif = double.MaxValue;
|
||||
ConsoleColor closestColor = ConsoleColor.White;
|
||||
|
||||
foreach (ConsoleColor consoleColor in Enum.GetValues(typeof(ConsoleColor)))
|
||||
{
|
||||
Color color = Color.FromName(consoleColor.ToString());
|
||||
|
||||
var colorA = new Rgb
|
||||
{
|
||||
R = targetColor.R,
|
||||
G = targetColor.G,
|
||||
B = targetColor.B
|
||||
};
|
||||
|
||||
var colorB = new Rgb
|
||||
{
|
||||
R = color.R,
|
||||
G = color.G,
|
||||
B = color.B
|
||||
};
|
||||
double diff = colorA.Compare(colorB, new Cie1976Comparison());
|
||||
|
||||
if (diff < minDif)
|
||||
{
|
||||
minDif = diff;
|
||||
closestColor = consoleColor;
|
||||
}
|
||||
}
|
||||
return closestColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
using DSharpPlus;
|
||||
using Stone_Red_Utilities.ColorConsole;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using System;
|
||||
|
||||
namespace DiscordCLI
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
public static void Main() => new Program().MainAsync().GetAwaiter().GetResult();
|
||||
|
||||
private DiscordClient client;
|
||||
private InputManager inputManager;
|
||||
private OutputManager outputManager;
|
||||
private CommandsManager commandsManager;
|
||||
|
||||
public const string tokenPath = "token.txt";
|
||||
|
||||
public async Task MainAsync()
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
Console.OutputEncoding = System.Text.Encoding.UTF8;
|
||||
|
||||
string token = string.Empty;
|
||||
if (File.Exists(tokenPath))
|
||||
token = File.ReadAllText(tokenPath);
|
||||
|
||||
tokenInput:
|
||||
while (string.IsNullOrWhiteSpace(token))
|
||||
{
|
||||
Console.Write("Enter auth token: ");
|
||||
token = Console.ReadLine();
|
||||
}
|
||||
|
||||
File.WriteAllText(tokenPath, token);
|
||||
|
||||
try
|
||||
{
|
||||
client = new DiscordClient(new DiscordConfiguration()
|
||||
{
|
||||
Token = token,
|
||||
TokenType = TokenType.User,
|
||||
});
|
||||
|
||||
client.MessageCreated += Client_MessageCreated;
|
||||
|
||||
await client.ConnectAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ConsoleExt.WriteLine(ex, ConsoleColor.Red);
|
||||
|
||||
if (ex.Message.Contains("Authentication failed"))
|
||||
{
|
||||
File.Delete(tokenPath);
|
||||
token = string.Empty;
|
||||
goto tokenInput;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
outputManager = new OutputManager(client);
|
||||
commandsManager = new CommandsManager(client, outputManager);
|
||||
inputManager = new InputManager(client, commandsManager);
|
||||
outputManager.InputManager = inputManager;
|
||||
|
||||
await inputManager.ReadInput();
|
||||
}
|
||||
|
||||
private async Task Client_MessageCreated(DSharpPlus.EventArgs.MessageCreateEventArgs e)
|
||||
{
|
||||
await outputManager.WriteMessage(e.Message, e.Channel, e.Guild);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Any CPU</Platform>
|
||||
<PublishDir>bin\Release\net5.0\publish\Linux-arm</PublishDir>
|
||||
<PublishProtocol>FileSystem</PublishProtocol>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<History>True|2021-05-27T05:47:11.2358523Z;</History>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Any CPU</Platform>
|
||||
<PublishDir>bin\Release\net5.0\publish\Linux-x64</PublishDir>
|
||||
<PublishProtocol>FileSystem</PublishProtocol>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
|
||||
<SelfContained>false</SelfContained>
|
||||
<PublishSingleFile>True</PublishSingleFile>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<History>True|2021-05-27T05:47:04.1968183Z;True|2021-05-27T07:46:41.8745649+02:00;</History>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Any CPU</Platform>
|
||||
<PublishDir>bin\Release\net5.0\publish\Windows</PublishDir>
|
||||
<PublishProtocol>FileSystem</PublishProtocol>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<SelfContained>false</SelfContained>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<History>True|2021-05-27T05:49:47.3666888Z;True|2021-05-27T07:46:50.5745814+02:00;</History>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"additionalProbingPaths": [
|
||||
"C:\\Users\\David\\.dotnet\\store\\|arch|\\|tfm|",
|
||||
"C:\\Users\\David\\.nuget\\packages",
|
||||
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages",
|
||||
"C:\\Program Files (x86)\\Microsoft\\Xamarin\\NuGet"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net5.0",
|
||||
"framework": {
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "5.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"additionalProbingPaths": [
|
||||
"C:\\Users\\David\\.dotnet\\store\\|arch|\\|tfm|",
|
||||
"C:\\Users\\David\\.nuget\\packages",
|
||||
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages",
|
||||
"C:\\Program Files (x86)\\Microsoft\\Xamarin\\NuGet"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net5.0",
|
||||
"framework": {
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "5.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"additionalProbingPaths": [
|
||||
"C:\\Users\\David\\.dotnet\\store\\|arch|\\|tfm|",
|
||||
"C:\\Users\\David\\.nuget\\packages",
|
||||
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages",
|
||||
"C:\\Program Files (x86)\\Microsoft\\Xamarin\\NuGet"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net5.0",
|
||||
"framework": {
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "5.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net5.0",
|
||||
"framework": {
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "5.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net5.0",
|
||||
"framework": {
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "5.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v5.0", FrameworkDisplayName = "")]
|
||||
@@ -0,0 +1,23 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Dieser Code wurde von einem Tool generiert.
|
||||
// Laufzeitversion:4.0.30319.42000
|
||||
//
|
||||
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
// der Code erneut generiert wird.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("DiscordCLI")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("DiscordCLI")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("DiscordCLI")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
// Von der MSBuild WriteCodeFragment-Klasse generiert.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
b19e6f37bddcbdb1df945fddaf2581ec8ab2932c
|
||||
@@ -0,0 +1,8 @@
|
||||
is_global = true
|
||||
build_property.TargetFramework = net5.0
|
||||
build_property.TargetPlatformMinVersion =
|
||||
build_property.UsingMicrosoftNETSdkWeb =
|
||||
build_property.ProjectTypeGuids =
|
||||
build_property.PublishSingleFile =
|
||||
build_property.IncludeAllContentForSelfExtract =
|
||||
build_property._SupportedPlatformList = Android,iOS,Linux,macOS,Windows
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
d74c436d6f045a94c6aefe230b53cf4fbca29cc5
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
3e2c7be251ce3e62a6541dac29e1895e802a69f2
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v3.1", FrameworkDisplayName = "")]
|
||||
@@ -0,0 +1,23 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Dieser Code wurde von einem Tool generiert.
|
||||
// Laufzeitversion:4.0.30319.42000
|
||||
//
|
||||
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
// der Code erneut generiert wird.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("DiscordCLI")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("DiscordCLI")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("DiscordCLI")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
// Von der MSBuild WriteCodeFragment-Klasse generiert.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
b19e6f37bddcbdb1df945fddaf2581ec8ab2932c
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
bb7f791519035a2baddccc4d9ea552ec90305859
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
e299abbf0e74657c0b5bb8ef0a778b4df7cd199f
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,82 @@
|
||||
{
|
||||
"format": 1,
|
||||
"restore": {
|
||||
"C:\\Users\\David\\Google Drive\\Programmieren\\DiscordCLI\\src\\DiscordCLI\\DiscordCLI.csproj": {}
|
||||
},
|
||||
"projects": {
|
||||
"C:\\Users\\David\\Google Drive\\Programmieren\\DiscordCLI\\src\\DiscordCLI\\DiscordCLI.csproj": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "C:\\Users\\David\\Google Drive\\Programmieren\\DiscordCLI\\src\\DiscordCLI\\DiscordCLI.csproj",
|
||||
"projectName": "DiscordCLI",
|
||||
"projectPath": "C:\\Users\\David\\Google Drive\\Programmieren\\DiscordCLI\\src\\DiscordCLI\\DiscordCLI.csproj",
|
||||
"packagesPath": "C:\\Users\\David\\.nuget\\packages\\",
|
||||
"outputPath": "C:\\Users\\David\\Google Drive\\Programmieren\\DiscordCLI\\src\\DiscordCLI\\obj\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"fallbackFolders": [
|
||||
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages",
|
||||
"C:\\Program Files (x86)\\Microsoft\\Xamarin\\NuGet\\"
|
||||
],
|
||||
"configFilePaths": [
|
||||
"C:\\Users\\David\\AppData\\Roaming\\NuGet\\NuGet.Config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"net5.0"
|
||||
],
|
||||
"sources": {
|
||||
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"net5.0": {
|
||||
"targetAlias": "net5.0",
|
||||
"projectReferences": {}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
}
|
||||
},
|
||||
"frameworks": {
|
||||
"net5.0": {
|
||||
"targetAlias": "net5.0",
|
||||
"dependencies": {
|
||||
"ColorMineStandard": {
|
||||
"target": "Package",
|
||||
"version": "[1.0.0, )"
|
||||
},
|
||||
"DSharpPlus": {
|
||||
"target": "Package",
|
||||
"version": "[3.2.3, )"
|
||||
},
|
||||
"Stone_Red-C-Sharp-Utilities": {
|
||||
"target": "Package",
|
||||
"version": "[1.0.0.2, )"
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"frameworkReferences": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.203\\RuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
|
||||
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
|
||||
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
|
||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\David\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages;C:\Program Files (x86)\Microsoft\Xamarin\NuGet\</NuGetPackageFolders>
|
||||
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">5.9.1</NuGetToolVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<SourceRoot Include="C:\Users\David\.nuget\packages\" />
|
||||
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
|
||||
<SourceRoot Include="C:\Program Files (x86)\Microsoft\Xamarin\NuGet\" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<PkgNewtonsoft_Json Condition=" '$(PkgNewtonsoft_Json)' == '' ">C:\Users\David\.nuget\packages\newtonsoft.json\10.0.3</PkgNewtonsoft_Json>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user