Browse Source

implement the new modify guild params

pull/1319/head
Chris Johnston 6 years ago
parent
commit
3bf75cd31e
2 changed files with 7 additions and 1 deletions
  1. +2
    -0
      src/Discord.Net.Rest/API/Rest/ModifyGuildParams.cs
  2. +5
    -1
      src/Discord.Net.Rest/Entities/Guilds/GuildHelper.cs

+ 2
- 0
src/Discord.Net.Rest/API/Rest/ModifyGuildParams.cs View File

@@ -30,5 +30,7 @@ namespace Discord.API.Rest
public Optional<ulong> OwnerId { get; set; } public Optional<ulong> OwnerId { get; set; }
[JsonProperty("explicit_content_filter")] [JsonProperty("explicit_content_filter")]
public Optional<ExplicitContentFilterLevel> ExplicitContentFilter { get; set; } public Optional<ExplicitContentFilterLevel> ExplicitContentFilter { get; set; }
[JsonProperty("system_channel_flags")]
public Optional<SystemChannelMessageDeny> SystemChannelFlags { get; set; }
} }
} }

+ 5
- 1
src/Discord.Net.Rest/Entities/Guilds/GuildHelper.cs View File

@@ -33,7 +33,8 @@ namespace Discord.Rest
Name = args.Name, Name = args.Name,
Splash = args.Splash.IsSpecified ? args.Splash.Value?.ToModel() : Optional.Create<ImageModel?>(), Splash = args.Splash.IsSpecified ? args.Splash.Value?.ToModel() : Optional.Create<ImageModel?>(),
VerificationLevel = args.VerificationLevel, VerificationLevel = args.VerificationLevel,
ExplicitContentFilter = args.ExplicitContentFilter
ExplicitContentFilter = args.ExplicitContentFilter,
SystemChannelFlags = args.SystemChannelFlags
}; };


if (args.AfkChannel.IsSpecified) if (args.AfkChannel.IsSpecified)
@@ -64,6 +65,9 @@ namespace Discord.Rest
if (args.ExplicitContentFilter.IsSpecified) if (args.ExplicitContentFilter.IsSpecified)
apiArgs.ExplicitContentFilter = args.ExplicitContentFilter.Value; apiArgs.ExplicitContentFilter = args.ExplicitContentFilter.Value;


if (args.SystemChannelFlags.IsSpecified)
apiArgs.SystemChannelFlags = args.SystemChannelFlags.Value;

return await client.ApiClient.ModifyGuildAsync(guild.Id, apiArgs, options).ConfigureAwait(false); return await client.ApiClient.ModifyGuildAsync(guild.Id, apiArgs, options).ConfigureAwait(false);
} }
/// <exception cref="ArgumentNullException"><paramref name="func"/> is <c>null</c>.</exception> /// <exception cref="ArgumentNullException"><paramref name="func"/> is <c>null</c>.</exception>


Loading…
Cancel
Save