예제 #1
0
        public async Task <PrivateChannel> CreatePrivateChannel(ulong userId)
        {
            var channel = GetPrivateChannel(userId);

            if (channel != null)
            {
                return(channel);
            }

            var request = new CreatePrivateChannelRequest()
            {
                RecipientId = userId
            };
            var response = await ClientAPI.Send(request).ConfigureAwait(false);

            return(AddPrivateChannel(response));
        }
예제 #2
0
        public async Task<Channel> CreatePrivateChannel(ulong userId)
        {
            var channel = GetPrivateChannel(userId);
            if (channel != null) return channel;

            var request = new CreatePrivateChannelRequest() { RecipientId = userId };
            var response = await ClientAPI.Send(request).ConfigureAwait(false);

            channel = AddPrivateChannel(response.Id, userId);
            channel.Update(response);
            return channel;
        }