You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Using app.Services.CreateScope() to load BotProperties? #1
I have a question regarding to this code snippet from the ShopBot:
// Make sure ShopBotProperties is working. _ = scope.ServiceProvider.GetRequiredService<ShopBotProperties>();
What is happening here exactly?
I did my own Bot using your library and the bot will never register a webhook with Telegram if I do not add this snippet also. Is it to force load the properties? Is this the best way to do it?
Hi, I'm really sorry for the delay.
The webhook was registered in the constructor of ShopBotproperties but I discated that approach because was ugly. Now I the bot use a hosted service to initialize the bot commands and webhook. That's the best way I have found until now, but you can try other approaches.
Activity
Eptagone commentedon Jan 2, 2025
Hi, I'm really sorry for the delay.
The webhook was registered in the constructor of
ShopBotpropertiesbut I discated that approach because was ugly. Now I the bot use a hosted service to initialize the bot commands and webhook. That's the best way I have found until now, but you can try other approaches.