Добавьте файлы проекта.

This commit is contained in:
Daria
2021-10-19 06:04:52 +03:00
parent 6ee25d0f59
commit eab3081ec2
187 changed files with 100839 additions and 0 deletions

133
SvetoforVKBot/Models/Bot.cs Normal file
View File

@@ -0,0 +1,133 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using SvetoforVKBot.Models.Commands;
using SvetoforVKBot.Models.Commands.Admin;
using VkNet;
using VkNet.Model;
using SvetoforVKBot.Models.Commands.Registration;
using SvetoforVKBot.Models.Commands.LK;
using SvetoforVKBot.Models.Commands.LK.Menu;
using SvetoforVKBot.Models.Commands.LK.Menu.Products;
using SvetoforVKBot.Models.Commands.LK.Calculators;
using SvetoforVKBot.Models.Commands.LK.Reports;
using SvetoforVKBot.Models.Commands.ExpertLK;
using SvetoforVKBot.Models.Commands.LK.Consultation;
using SvetoforVKBot.Models.Commands.LK.Cart;
using SvetoforVKBot.Models.Commands.LK.Tracks;
using SvetoforVKBot.Models.Commands.LK.EditData;
using SvetoforVKBot.Models.Commands.Water;
using System.Configuration;
using SvetoforVKBot.App_Start;
namespace SvetoforVKBot.Models
{
public static class Bot
{
private static VkApi client;
private static List<Command> commandsList;
public static IReadOnlyList<Command> Commands => commandsList.AsReadOnly();
public static async Task<VkApi> Get()
{
commandsList = new List<Command>
{
//Основные
new StartCommand(),
new StartLowerCommand(),
new StartPLCommand(),
new SelectRoleCommand(),
new SelectAboutCommand(),
new SelectAskQuestionsCommand(),
//Регистрация
new SelectParticipateCommand(),
new SelectChildAgeCommand(),
new SelectAgreementCommand(),
new SelectAcceptPDCommand(),
new SelectDateCommand(),
new SelectDateNavigationCommand(),
new SelectDRMonthCommand(),
new SelectGenderCommand(),
new SelectActivityCoefCommand(),
new SelectActivityKindCommand(),
new SelectSportsCommand(),
new SelectDayCommand(),
new SelectNotifyCountCommand(),
new SelectVyatsuRoleCommand(),
//Личный кабинет
new SelectEditDataCommand(),
new SelectMenuCommand(),
new SelectDayMenuCommand(),
new SelectColorCommand(),
new SelectProductCommand(),
new SelectCalculatorCcalCommand(),
new SelectCalcCcalResultCommand(),
new SelectIdealWeightCommand(),
new SelectCreateReportCommand(),
new SelectReportRateCommand(),
new SelectReportCcalCommand(),
new SelectConsultationCommand(),
new SelectPersonalMenuCommand(),
//Редактирование данных
new SelectEditNotifyCount(),
new SelectUpdateSportDaysCommand(),
//Вода
new SelectGoWaterNotifyCommand(),
new SelectOffWaterNotifyCommand(),
new SelectWaterNotifyCountCommand(),
//Треки
new SelectTrackCommand(),
new SelectRationCommand(),
new SelectExampleMenuCommand(),
new SelectChooseTrackCommand(),
//Корзина
new SelectAddToCartCommand(),
new SelectCartCommand(),
new SelectEditCartCommand(),
new SelectConfirmClearCartCommand(),
//Дополнительные
new SelectAskQuestionsCommand(),
//Админ
new SelectGetPhotoCommand(),
new SelectAdminCommand(),
new SelectStatisticCommand(),
new SelectTestNotifyCommand(),
//Консультации
new SelectLiveConsultationCommand(),
new SelectSubmitConsultationCommand(),
new SelectMoreAboutSpecCommand(),
//Эксперт
new SelectExpertLKCommand(),
new SelectParticipantsCommand(),
new SelectParticipantInfoCommand(),
new SelectUpPersonalPlanCommand(),
new SelectPersonalPlanCommand(),
//Питание
new SelectDayFoodCommand(),
};
client = new VkApi();
await client.AuthorizeAsync(new ApiAuthParams
{
AccessToken = ((WebConfiguration)ConfigurationManager.GetSection("VKApi")).Token
});
return client;
}
}
}