Skip to content

Using app.Services.CreateScope() to load BotProperties? #1

@fseffert

Description

@fseffert

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?

Thank you for helping me out :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions