예제 #1
0
        public RestManager(DisharpClient client, DisharpRestClient rest)
        {
            _client  = client;
            _token   = _client.Token;
            _sweeper = new Timer(300000);

            RestClient = new RestClient();
            Rest       = rest;

            _sweeper.AutoReset = true;
            _sweeper.Start();
            _sweeper.Elapsed += OnSweeperOnElapsed;
        }
예제 #2
0
        public async Task LoginAsync(TokenType tokenType, string token)
        {
            TokenType = tokenType;
            Token     = token;

            Ws   = new DisharpWebSocketClient(this);
            Rest = new DisharpRestClient(this);

            UnavailableGuilds = new Cache <Guild>(this);
            Guilds            = new Cache <Guild>(this);

            await Ws.ConnectAsync();
        }