예제 #1
0
 public async Task ModifyGuildMemberAsync(ulong guildId, ulong userId, ModifyGuildMemberArgs packet)
 {
     await RatelimitHelper.ProcessRateLimitedAsync(
         $"guilds:{guildId}", cache,
         async() =>
     {
         return(await RestClient.PatchAsync($"/guilds/{guildId}/members/{userId}",
                                            JsonConvert.SerializeObject(packet, serializer)
                                            ));
     });
 }
예제 #2
0
        /// <inheritdoc/>
        public async Task ModifyGuildMemberAsync(
            ulong guildId,
            ulong userId,
            ModifyGuildMemberArgs packet)
        {
            var response = await httpClient.PatchAsync(
                DiscordApiRoutes.GuildMember(guildId, userId),
                JsonSerializer.Serialize(packet, options))
                           .ConfigureAwait(false);

            HandleErrors(response, options);
        }
예제 #3
0
        public async ValueTask ModifyGuildMemberAsync(
            ulong guildId,
            ulong userId,
            ModifyGuildMemberArgs packet)
        {
            var response = await RestClient.PatchJsonAsync(
                DiscordApiRoutes.GuildMember(guildId, userId),
                packet)
                           .ConfigureAwait(false);

            HandleErrors(response);
        }