feat: added export to csv file

This commit is contained in:
Savely Savianok
2025-02-11 22:37:33 +03:00
parent e9db40dee9
commit d0ad97f08b
8 changed files with 130 additions and 74 deletions

View File

@@ -1,4 +1,6 @@
namespace TelegramMessageCounter;
using System.Reflection;
namespace TelegramMessageCounter;
public static class ArgumentReader
{
@@ -8,13 +10,12 @@ public static class ArgumentReader
string? username = null;
if (args.Length > 0 && args.Any(x => x == "--help"))
{
Console.WriteLine("Usage: TelegramMessageCounter --login (phone number) --user (username) <path>" +
"\n login - Phone number of telegram. If argument is empty, waiting for Keyboard interrupt" +
"\nuser - Username of telegram for individual stats. If argument is empty, analyzing all user history" +
"\n path - Path to save results file. If argument is empty, path will be \"results.txt\"\n");
var helpFile = Assembly.GetExecutingAssembly()
.GetManifestResourceStream("TelegramMessageCounter.help.txt");
Console.WriteLine(new StreamReader(helpFile ?? new MemoryStream()).ReadToEnd());
Environment.Exit(0);
}
if (args.Any(x => x == "--user"))
{
var userNameArgIndex = args.ToList().IndexOf("--user");