Пример #1
0
        internal Task RemoveBitsReceivedAsync(RestTokenInfo info)
        {
            string topic   = $"whispers.{info.UserId}";
            var    request = new PubsubRequest("UNLISTEN")
                             .WithData(info.Token, topic);

            return(SendAsync(request));
        }
Пример #2
0
        internal Task RemoveWhisperAsync(RestTokenInfo info)
        {
            if (!info.Authorization?.Scopes.Contains("chat_login") ?? false)
            {
                throw new MissingScopeException("chat_login");
            }

            string topic   = $"whispers.{info.UserId}";
            var    request = new PubsubRequest("UNLISTEN")
                             .WithData(info.Token, topic);

            return(SendAsync(request));
        }
Пример #3
0
        public async Task ConnectAsync(RestTokenInfo auth)
        {
            await _chat.ConnectAsync();

            await _chat.AuthorizeAsync(auth.Username, auth.Token);

            if (_config.RequestTags)
            {
                await _chat.RequestTagsAsync().ConfigureAwait(false);
            }
            if (_config.RequestCommands)
            {
                await _chat.RequestCommandsAsync().ConfigureAwait(false);
            }
            if (_config.RequestMembership)
            {
                await _chat.RequestMembershipAsync().ConfigureAwait(false);
            }
        }