public BotManager(IBotApiProvider apiProvider, IServiceProvider provider, char prefix, bool sendErrorLogToUser) { _apiProvider = apiProvider; _serviceProvider = provider; _prefix = prefix; _sendErrorLogToUser = sendErrorLogToUser; _commandParser = new CommandParser(); }
public BotManager Build(IBotApiProvider apiProvider) { ServiceCollection.AddSingleton(new CommandTypeProvider(_commandTypes, _caseSensitive)); ServiceProvider serviceProvider = ServiceCollection.BuildServiceProvider(); return(new BotManager(apiProvider, serviceProvider, _prefix, _sendErrorLogToUser)); }
public BotManager(IBotApiProvider apiProvider, CommandHandler commandHandler, char prefix, bool sendErrorLogToUser) { _apiProvider = apiProvider; _prefix = prefix; _sendErrorLogToUser = sendErrorLogToUser; _commandParser = new CommandParser(); _commandHandler = commandHandler; }
public BotManager Build(IBotApiProvider apiProvider) { ServiceProvider serviceProvider = ServiceCollection.BuildServiceProvider(); var commandHandler = new CommandHandler(serviceProvider); _commands.ForEach(commandHandler.RegisterCommand); commandHandler.SetCaseSensitive(_caseSensitive); return(new BotManager(apiProvider, commandHandler, _prefix, _sendErrorLogToUser)); }
public Bot(IBotApiProvider botProvider) { _botProvider = botProvider; _commandHandler = new CommandHandler(new CommandsList()); _commandHandler.RegisterCommand(new PingCommand()); _commandHandler.RegisterCommand(new HelpCommand(_commandHandler.GetCommands())); _commandHandler.RegisterCommand(new ScheduleCommand()); _commandHandler.RegisterCommand(new SetGroupCommand()); }
public void Send(IBotApiProvider apiProvider, SenderInfo sender) { if (MediaFile is IBotOnlineFile onlineFile) { apiProvider.SendOnlineMedia(onlineFile, Text, sender); } else { apiProvider.SendMedia(MediaFile, Text, sender); } }
public QueBot(IBotApiProvider apiProvider /*, ILogger logger*/) { BotManagerBuilder builder = new BotManagerBuilder() //.AddLogger(logger) .SetPrefix('/') .AddCommand(new AddQueamQueserCommand.Descriptor()) .AddCommand(new AddQueamQueserCommand.Descriptor()) .AddCommand(new CreateQueamCommand.Descriptor()) .AddCommand(new GetQueamsCommand.Descriptor()) .AddCommand(new DeleteQueamCommand.Descriptor()) .AddCommand(new RemoveQueamQueserCommand.Descriptor()) .AddCommand(new CreateQueCommand.Descriptor()) .AddCommand(new DeleteQueCommand.Descriptor()) .AddCommand(new QuePopCommand.Descriptor()) .AddCommand(new QuePushCommand.Descriptor()) .AddCommand(new QueSwapCommand.Descriptor()); builder.ServiceCollection .AddQuewerDatabase(); _botInstance = builder.Build(apiProvider); }
public void Send(IBotApiProvider apiProvider, SenderInfo sender) { apiProvider.SendMultipleMedia(MediaFiles, Text, sender); }
public void Send(IBotApiProvider apiProvider, SenderInfo sender) { apiProvider.SendText(Text, sender); }
public async Task SendAsync(IBotApiProvider apiProvider, SenderInfo sender) { await apiProvider.SendMediaAsync(MediaFile, Text, sender); }
public async Task SendAsync(IBotApiProvider apiProvider, SenderInfo sender) { await apiProvider.SendTextMessageAsync(Text, sender); }