commit 31ef42b8288f1a403f8b5dd9eaa234da3acac7c9 Author: Chris Plaatjes Date: Mon Feb 13 16:34:22 2023 -0500 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8d4a6c0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +bin +obj \ No newline at end of file diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..281553e --- /dev/null +++ b/Program.cs @@ -0,0 +1,25 @@ +using Microsoft.Extensions.Configuration; +using System; +using Telegram.Bot; + +namespace TeleTok +{ + class TeleTok + { + static async Task Main(string[] args) + { + var config = new ConfigurationBuilder() + .SetBasePath(Directory.GetCurrentDirectory()) + .AddJsonFile("config.json", true) + .Build(); + + var token = config.GetSection("TeleTokConf:token").Value; + + var botClient = new TelegramBotClient(token); + + var me = await botClient.GetMeAsync(); + + Console.WriteLine($"Hello world! I am user {me.Id} and my name is {me.FirstName}."); + } + } +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/TeleTok.csproj b/TeleTok.csproj new file mode 100644 index 0000000..42d88b4 --- /dev/null +++ b/TeleTok.csproj @@ -0,0 +1,16 @@ + + + + Exe + net6.0 + enable + enable + + + + + + + + + diff --git a/config.json b/config.json new file mode 100644 index 0000000..846321e --- /dev/null +++ b/config.json @@ -0,0 +1,6 @@ +{ + "TeleTokConf": { + "token": "INSERT TOKEN HERE", + "port": 5000 + } +} \ No newline at end of file