示例#1
0
        private async Task HandleMenuCommandAsync(Message message)
        {
            var user = message.From;
            var chat = message.Chat;

            if (MenuManager.TryGetMenu(user, chat.Id, out var menu))
            {
                await menu.DeleteAsync( ).ConfigureAwait(false);

                MenuManager.Remove(user, chat.Id);
            }

            menu = new TelegramKeyboardMenu(user, chat, this);
            MenuManager.AddOrUpdateMenu(menu);
            await menu.DisplayAsync(new MainPage ( menu )).ConfigureAwait(false);
        }