public Bot(IServiceProvider serviceProvider) { _serviceProvider = serviceProvider; _client = _serviceProvider.GetService <DiscordSocketClient>(); _commands = _serviceProvider.GetService <CommandService>(); _logEventHandler = _serviceProvider.GetService <ILogEventHandler>(); _messageEventHandler = _serviceProvider.GetService <IMessageEventHandler>(); _reactionEventHandler = _serviceProvider.GetService <IReactionEventHandler>(); AttachEventHandlers(); RegisterCommandModules(); }
public ILogEventHandlerContractToViewHostAdapter(ILogEventHandler contract) { _contract = contract; _handle = new ContractHandle(contract); }
/// <inheritdoc /> public void UnRegister(ILogEventHandler eventHandler) { lock (_syncObject) { _logHandlers.Remove(eventHandler); } }
/// <inheritdoc /> public void Register(ILogEventHandler eventHandler) { lock (_syncObject) { _logHandlers.Add(eventHandler); } }