예제 #1
0
        public async Task ModifyAsync(Action <UserModifyArgs> modifyArgs)
        {
            var args = new UserModifyArgs();

            modifyArgs(args);
            await client.ApiClient.ModifySelfAsync(args);
        }
예제 #2
0
        public ValueTask ModifyAsync(Action <UserModifyArgs> modifyArgs)
        {
            var args = new UserModifyArgs();

            modifyArgs(args);
            Username = args.Username;

            if (args.Avatar != null)
            {
                throw new NotImplementedException();
            }

            return(default);
예제 #3
0
        public async ValueTask ModifySelfAsync(UserModifyArgs args)
        {
            if (args.Avatar.Type == ImageType.WEBP)
            {
                throw new InvalidDataException("Can't upload WEBP images.");
            }

            var response = await RestClient.PatchJsonAsync(
                DiscordApiRoutes.UserMe(),
                args)
                           .ConfigureAwait(false);

            HandleErrors(response);
        }
예제 #4
0
        /// <inheritdoc/>
        public async Task ModifySelfAsync(UserModifyArgs args)
        {
            if (args.Avatar.Type == ImageType.WEBP)
            {
                throw new InvalidDataException("Can't upload WEBP images.");
            }

            var json     = JsonSerializer.Serialize(args, options);
            var response = await httpClient.PatchAsync(
                DiscordApiRoutes.UserMe(),
                json)
                           .ConfigureAwait(false);

            HandleErrors(response, options);
        }
예제 #5
0
 public ValueTask ModifySelfAsync(UserModifyArgs args)
 {
     throw new NotImplementedException();
 }