File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed
Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,32 @@ info: TelegramBot.ConsoleTest.Controllers.HomeController[0]
6767
6868<p align =" right " ><a href =" #readme-top " >back to top</a ></p >
6969
70+ ## Features
71+
72+ * Dependency Injection - use ` Services ` property of ` BotBuilder ` to add services:
73+
74+ ``` CSharp
75+ builder .Services .AddDbContext <AppDbContext >(x => x .UseNpgsql (connectionString ));
76+ ```
77+
78+ * Send response to client - use ` BotControllerBase ` methods - ` Inline ` , ` Text ` , ` MarkDown ` :
79+
80+ ``` CSharp
81+ [BotCommand (" /start" )]
82+ public async Task < IActionResult > HandleStartAsync ()
83+ {
84+ string prompt = await _dbContext .Translations .GetTranslationAsync (" WelcomePrompt" , Language .English );
85+ InlineKeyboardMarkup keyboard = new KeyboardBuilder ()
86+ .WithColumns (2 )
87+ .AddButton (" 🇺🇸 English" , " /language/en" )
88+ .AddButton (" 🇷🇺 Русский" , " /language/ru" )
89+ .AddButton (" 🇪🇸 Español" , " /language/es" )
90+ .AddButton (" 🇺🇦 Українська" , " /language/uk" )
91+ .Build ();
92+ return Inline (prompt , keyboard );
93+ }
94+ ```
95+
7096## Roadmap
7197
7298- [x] Add command handlers
@@ -100,4 +126,4 @@ Distributed under the MIT License. See LICENSE.md for more information.
100126
101127# Contact
102128
103- [ E-Mail] ( mailto:github-telegram-bot-net@belov.us )
129+ [ E-Mail] ( mailto:github-telegram-bot-net@belov.us )
You can’t perform that action at this time.
0 commit comments