public async Task MainAsync() { await InitConfig(); _client = new DiscordSocketClient(); _commands = new CommandService(); _listener = new NetworkListener(); _listener.NewDhcpConnection += HandleDhcpConnection; _client.Log += Log; _client.Ready += () => { var c = _client.GetChannel(channelId); channel = (IMessageChannel)_client.GetChannel(channelId); _listener.Start(); return(Task.CompletedTask); }; await _client.LoginAsync(TokenType.Bot, token); await _client.StartAsync(); var commandHandler = new CommandHandler(BuildServiceProvider(), _client, _commands); await commandHandler.InstallCommandsAsync(); await Task.Delay(-1); }
public InfoModule(NetworkListener l) { _listener = l; }