Beispiel #1
0
        public DiscordAllowList(ILogger <DiscordAllowList> logger, DiscordShardedClient discord, IConfiguration config, IServerFileStore fileStore)
        {
            _logger = logger;
            string discordToken = config["Tokens:Discord"];         // Get the discord token from the config file

            discord.LoginAsync(TokenType.Bot, discordToken).Wait(); // Login to discord
            discord.StartAsync().Wait();                            // Connect to the websocket
            _discord   = discord;
            _fileStore = fileStore;
        }
Beispiel #2
0
        public DockerInterface(ILogger <DockerInterface> logger, IOptions <SteamLoginOptions> steamLoginOptions, IIpGetter ipGetter, IServerFileStore fileStore)
        {
            _logger            = logger;
            _steamLoginOptions = steamLoginOptions.Value;
            _ipGetter          = ipGetter;
            _fileStore         = fileStore;
            var os = Environment.OSVersion;

            if (os.Platform == PlatformID.Unix)
            {
                _client = new DockerClientConfiguration(
                    new Uri("unix:///var/run/docker.sock"))
                          .CreateClient();
            }
            else if (os.Platform == PlatformID.Win32NT)
            {
                _client = new DockerClientConfiguration(
                    new Uri("npipe://./pipe/docker_engine"))
                          .CreateClient();
            }
        }