This repository has been archived by the owner on Dec 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
UpdateContext
Fedorus edited this page Jul 14, 2021
·
1 revision
Default context looks like this:
public class BaseUpdateContext : IUpdateContext
{
public Update Update { get; set; }
public HttpContext HttpContext { get; set; }
public TaskCompletionSource Result { get; set; }
public IServiceProvider Services { get; set; }
public UserState UserState { get; set; } = new UserState();
public BaseBot Bot { get; set; }
public TelegramBotClient Client { get; set; }
}
Update - current update object HttpContext and Result - objects for webhook scenarios handling Services - in case you need access to DI. Bot - your bot class instance with bot username and other settings Client - instance of telegram BOT api wrapper UserState instance of:
public class UserState
{
public string Stage { get; set; } = "default";
public int Step { get; set; }
public Role Role { get; set; }
public string LanguageCode { get; set; }
}
All this fields used for Stages/States and describe each user individually.