Browse Source

simplidied location field

pull/2483/head
Rennorb 2 years ago
parent
commit
4643eafd11
2 changed files with 5 additions and 7 deletions
  1. +3
    -3
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/ScheduledEventInfo.cs
  2. +2
    -4
      src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/ScheduledEventUpdateAuditLogData.cs

+ 3
- 3
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/ScheduledEventInfo.cs View File

@@ -48,9 +48,9 @@ namespace Discord.Rest
/// </summary>
public ulong? EntityId { get; }
/// <summary>
/// Gets the metadata for the entity associated with the event.
/// Gets the metadata for the entity associated with the event. <see cref="Optional{T}.Unspecified"/> if there was no change.
/// </summary>
public Optional<string>? Location { get; }
public Optional<string> Location { get; }
/// <summary>
/// Gets the count of users interested in this event.
/// </summary>
@@ -60,7 +60,7 @@ namespace Discord.Rest
/// </summary>
public string Image { get; }

internal ScheduledEventInfo(ulong? guildId, ulong? channelId, string name, string description, DateTimeOffset? scheduledStartTime, DateTimeOffset? scheduledEndTime, GuildScheduledEventPrivacyLevel? privacyLevel, GuildScheduledEventStatus? status, GuildScheduledEventType? entityType, ulong? entityId, Optional<string>? location, int? userCount, string image)
internal ScheduledEventInfo(ulong? guildId, ulong? channelId, string name, string description, DateTimeOffset? scheduledStartTime, DateTimeOffset? scheduledEndTime, GuildScheduledEventPrivacyLevel? privacyLevel, GuildScheduledEventStatus? status, GuildScheduledEventType? entityType, ulong? entityId, Optional<string> location, int? userCount, string image)
{
GuildId = guildId ;
ChannelId = channelId ;


+ 2
- 4
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/ScheduledEventUpdateAuditLogData.cs View File

@@ -1,10 +1,8 @@
using System;
using System.Linq;
using Discord.API;

using Model = Discord.API.AuditLog;
using EntryModel = Discord.API.AuditLogEntry;
using Newtonsoft.Json.Linq;

namespace Discord.Rest
{
@@ -52,7 +50,7 @@ namespace Discord.Rest
status?.OldValue.ToObject<GuildScheduledEventStatus>(discord.ApiClient.Serializer),
entityType?.OldValue.ToObject<GuildScheduledEventType>(discord.ApiClient.Serializer),
entityId?.OldValue.ToObject<ulong?>(discord.ApiClient.Serializer),
location == null ? null : location.OldValue?.ToObject<string>(discord.ApiClient.Serializer) ?? Optional<string>.Unspecified,
location == null ? Optional<string>.Unspecified : new Optional<string>(location.OldValue?.ToObject<string>(discord.ApiClient.Serializer)),
userCount?.OldValue.ToObject<Optional<int>>(discord.ApiClient.Serializer)
.GetValueOrDefault(),
image?.OldValue.ToObject<Optional<string>>(discord.ApiClient.Serializer)
@@ -70,7 +68,7 @@ namespace Discord.Rest
status?.NewValue.ToObject<GuildScheduledEventStatus>(discord.ApiClient.Serializer),
entityType?.NewValue.ToObject<GuildScheduledEventType>(discord.ApiClient.Serializer),
entityId?.NewValue.ToObject<ulong?>(discord.ApiClient.Serializer),
location == null ? null : location.NewValue?.ToObject<string>(discord.ApiClient.Serializer) ?? Optional<string>.Unspecified,
location == null ? Optional<string>.Unspecified : new Optional<string>(location.NewValue?.ToObject<string>(discord.ApiClient.Serializer)),
userCount?.NewValue.ToObject<Optional<int>>(discord.ApiClient.Serializer)
.GetValueOrDefault(),
image?.NewValue.ToObject<Optional<string>>(discord.ApiClient.Serializer)


Loading…
Cancel
Save