Adding /start command handling to test project
This commit is contained in:
parent
73863c4154
commit
ca473f78ed
@ -27,6 +27,8 @@ namespace InlineAndReplyCombination
|
||||
|
||||
await BotBaseInstance.UploadBotCommands();
|
||||
|
||||
BotBaseInstance.BotCommand += BotBaseInstance_BotCommand;
|
||||
|
||||
|
||||
await BotBaseInstance.Start();
|
||||
|
||||
@ -37,5 +39,28 @@ namespace InlineAndReplyCombination
|
||||
|
||||
await BotBaseInstance.Stop();
|
||||
}
|
||||
|
||||
private static async Task BotBaseInstance_BotCommand(object sender, TelegramBotBase.Args.BotCommandEventArgs e)
|
||||
{
|
||||
|
||||
switch(e.Command)
|
||||
{
|
||||
case "/start":
|
||||
|
||||
|
||||
var start = new StartForm();
|
||||
|
||||
await e.Device.ActiveForm.NavigateTo(start);
|
||||
|
||||
|
||||
break;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user