From 003f17a9d5416230f28187df18ded7776acbda93 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Mon, 20 Feb 2023 01:18:39 +0100 Subject: [PATCH] Initial commit --- .gitignore | 184 +++++++++++++++++++++++++++++++++++++++ Program.cs | 13 +++ Telegram.Bot.Send.csproj | 19 ++++ Telegram.Bot.Send.sln | 16 ++++ 4 files changed, 232 insertions(+) create mode 100644 .gitignore create mode 100644 Program.cs create mode 100644 Telegram.Bot.Send.csproj create mode 100644 Telegram.Bot.Send.sln diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3dab6af --- /dev/null +++ b/.gitignore @@ -0,0 +1,184 @@ +/packages/ +/_ReSharper.Caches/ + +# Created by https://www.toptal.com/developers/gitignore/api/rider,dotnetcore,jetbrains+all +# Edit at https://www.toptal.com/developers/gitignore?templates=rider,dotnetcore,jetbrains+all + +### DotnetCore ### +# .NET Core build folders +bin/ +obj/ + +# Common node modules locations +/node_modules +/wwwroot/node_modules + +### JetBrains+all ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### JetBrains+all Patch ### +# Ignores the whole .idea folder and all .iml files +# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360 + +.idea/ + +# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023 + +*.iml +modules.xml +.idea/misc.xml +*.ipr + +# Sonarlint plugin +.idea/sonarlint + +### Rider ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff + +# Generated files + +# Sensitive or high-churn files + +# Gradle + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake + +# Mongo Explorer plugin + +# File-based project format + +# IntelliJ + +# mpeltonen/sbt-idea plugin + +# JIRA plugin + +# Cursive Clojure plugin + +# Crashlytics plugin (for Android Studio and IntelliJ) + +# Editor-based Rest Client + +# Android studio 3.1+ serialized cache file + +# End of https://www.toptal.com/developers/gitignore/api/rider,dotnetcore,jetbrains+all + + +# Created by https://www.toptal.com/developers/gitignore/api/macos +# Edit at https://www.toptal.com/developers/gitignore?templates=macos + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# End of https://www.toptal.com/developers/gitignore/api/macos \ No newline at end of file diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..7e42bbc --- /dev/null +++ b/Program.cs @@ -0,0 +1,13 @@ +using Telegram.Bot; + +if (args.Length != 3) { + Console.WriteLine("Syntax: telegram-send "); + Environment.Exit(1); +} + +var token = args[0]; +var chatId = args[1]; +var message = args[2]; +var bot = new TelegramBotClient(token); + +await bot.SendTextMessageAsync(chatId, message); diff --git a/Telegram.Bot.Send.csproj b/Telegram.Bot.Send.csproj new file mode 100644 index 0000000..4c5d580 --- /dev/null +++ b/Telegram.Bot.Send.csproj @@ -0,0 +1,19 @@ + + + + Exe + net7.0 + enable + enable + partial + + + + + + + + + + + diff --git a/Telegram.Bot.Send.sln b/Telegram.Bot.Send.sln new file mode 100644 index 0000000..28682f3 --- /dev/null +++ b/Telegram.Bot.Send.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Telegram.Bot.Send", "Telegram.Bot.Send.csproj", "{977C0CF5-70D8-48A4-A287-16A81585A74F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {977C0CF5-70D8-48A4-A287-16A81585A74F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {977C0CF5-70D8-48A4-A287-16A81585A74F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {977C0CF5-70D8-48A4-A287-16A81585A74F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {977C0CF5-70D8-48A4-A287-16A81585A74F}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal