Skip to content

Commit

Permalink
feat: Add missing channel entries
Browse files Browse the repository at this point in the history
  • Loading branch information
TheXorog committed Oct 17, 2023
1 parent c0b8d9c commit 08c0eee
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,32 @@ internal ChannelCreateChangeSet()
public DiscordChannel Channel => this.Discord.Guilds[this.GuildId].Channels[this.TargetId!.Value];

public string Name => (string)this.Changes.FirstOrDefault(x => x.Key == "name")?.NewValue;
public string? Topic => (string?)this.Changes.FirstOrDefault(x => x.Key == "topic")?.NewValue;
public ChannelType Type => (ChannelType)this.Changes.FirstOrDefault(x => x.Key == "type")?.NewValue;
public string? Topic => (string?)this.Changes.FirstOrDefault(x => x.Key == "topic")?.NewValue;
public int? Position => (int?)this.Changes.FirstOrDefault(x => x.Key == "position")?.NewValue;
public DiscordOverwrite[] PermissionOverwrites => (DiscordOverwrite[])this.Changes.FirstOrDefault(x => x.Key == "permission_overwrites")?.NewValue;
public bool IsNfsw => (bool)this.Changes.FirstOrDefault(x => x.Key == "nsfw")?.NewValue;
public int PerUserRateLimit => (int)this.Changes.FirstOrDefault(x => x.Key == "rate_limit_per_user")?.NewValue;
public ThreadAutoArchiveDuration? DefaultAutoArchiveDuration => (ThreadAutoArchiveDuration?)this.Changes.FirstOrDefault(x => x.Key == "default_auto_archive_duration")?.NewValue;
public DiscordEmoji? IconEmoji => (DiscordEmoji?)this.Changes.FirstOrDefault(x => x.Key == "icon_emoji")?.NewValue;
public ForumPostTag? AvailableTags => (ForumPostTag?)this.Changes.FirstOrDefault(x => x.Key == "available_tags")?.NewValue;
public ThreadAutoArchiveDuration? DefaultAutoArchiveDuration => (ThreadAutoArchiveDuration?)this.Changes.FirstOrDefault(x => x.Key == "default_auto_archive_duration")?.NewValue;
public ChannelFlags Flags => (ChannelFlags)this.Changes.FirstOrDefault(x => x.Key == "flags")?.NewValue;

public ulong? ParentId => (ulong?)this.Changes.FirstOrDefault(x => x.Key == "parent_id")?.NewValue;
public DiscordChannel? Parent => this.Discord.Guilds[this.GuildId].Channels[this.ParentId.Value];

#region Voice
public int? Bitrate => (int?)this.Changes.FirstOrDefault(x => x.Key == "bitrate")?.NewValue;
public int? UserLimit => (int?)this.Changes.FirstOrDefault(x => x.Key == "user_limit")?.NewValue;
public string? RtcRegionId => (string?)this.Changes.FirstOrDefault(x => x.Key == "rtc_region")?.NewValue;
public DiscordVoiceRegion? RtcRegion => this.Discord.VoiceRegions[this.RtcRegionId];
public VideoQualityMode? VideoQualityMode => (VideoQualityMode?)this.Changes.FirstOrDefault(x => x.Key == "video_quality_mode")?.NewValue;
#endregion

#region Forum
public ForumPostTag? AvailableTags => (ForumPostTag?)this.Changes.FirstOrDefault(x => x.Key == "available_tags")?.NewValue;
public ForumReactionEmoji? DefaultReactionEmoji => (ForumReactionEmoji?)this.Changes.FirstOrDefault(x => x.Key == "default_reaction_emoji")?.NewValue;
public ForumPostSortOrder? DefaultSortOrder => (ForumPostSortOrder?)this.Changes.FirstOrDefault(x => x.Key == "default_sort_order")?.NewValue;
public ForumLayout? DefaultLayout => (ForumLayout?)this.Changes.FirstOrDefault(x => x.Key == "default_forum_layout")?.NewValue;
public int DefaultThreadPerUserRateLimit => (int)this.Changes.FirstOrDefault(x => x.Key == "default_thread_rate_limit_per_user")?.NewValue;
#endregion
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,32 @@ internal ChannelDeleteChangeSet()
}

public string Name => (string)this.Changes.FirstOrDefault(x => x.Key == "name")?.OldValue;
public string? Topic => (string?)this.Changes.FirstOrDefault(x => x.Key == "topic")?.OldValue;
public ChannelType Type => (ChannelType)this.Changes.FirstOrDefault(x => x.Key == "type")?.OldValue;
public string? Topic => (string?)this.Changes.FirstOrDefault(x => x.Key == "topic")?.OldValue;
public int? Position => (int?)this.Changes.FirstOrDefault(x => x.Key == "position")?.OldValue;
public DiscordOverwrite[] PermissionOverwrites => (DiscordOverwrite[])this.Changes.FirstOrDefault(x => x.Key == "permission_overwrites")?.OldValue;
public bool IsNfsw => (bool)this.Changes.FirstOrDefault(x => x.Key == "nsfw")?.OldValue;
public int PerUserRateLimit => (int)this.Changes.FirstOrDefault(x => x.Key == "rate_limit_per_user")?.OldValue;
public ThreadAutoArchiveDuration? DefaultAutoArchiveDuration => (ThreadAutoArchiveDuration?)this.Changes.FirstOrDefault(x => x.Key == "default_auto_archive_duration")?.NewValue;
public DiscordEmoji? IconEmoji => (DiscordEmoji?)this.Changes.FirstOrDefault(x => x.Key == "icon_emoji")?.OldValue;
public ForumPostTag? AvailableTags => (ForumPostTag?)this.Changes.FirstOrDefault(x => x.Key == "available_tags")?.OldValue;
public ThreadAutoArchiveDuration? DefaultAutoArchiveDuration => (ThreadAutoArchiveDuration?)this.Changes.FirstOrDefault(x => x.Key == "default_auto_archive_duration")?.OldValue;
public ChannelFlags Flags => (ChannelFlags)this.Changes.FirstOrDefault(x => x.Key == "flags")?.OldValue;

public ulong? ParentId => (ulong?)this.Changes.FirstOrDefault(x => x.Key == "parent_id")?.OldValue;
public DiscordChannel? Parent => this.Discord.Guilds[this.GuildId].Channels[this.ParentId.Value];

#region Voice
public int? Bitrate => (int?)this.Changes.FirstOrDefault(x => x.Key == "bitrate")?.OldValue;
public int? UserLimit => (int?)this.Changes.FirstOrDefault(x => x.Key == "user_limit")?.OldValue;
public string? RtcRegionId => (string?)this.Changes.FirstOrDefault(x => x.Key == "rtc_region")?.OldValue;
public DiscordVoiceRegion? RtcRegion => this.Discord.VoiceRegions[this.RtcRegionId];
public VideoQualityMode? VideoQualityMode => (VideoQualityMode?)this.Changes.FirstOrDefault(x => x.Key == "video_quality_mode")?.OldValue;
#endregion

#region Forum
public ForumPostTag? AvailableTags => (ForumPostTag?)this.Changes.FirstOrDefault(x => x.Key == "available_tags")?.OldValue;
public ForumReactionEmoji? DefaultReactionEmoji => (ForumReactionEmoji?)this.Changes.FirstOrDefault(x => x.Key == "default_reaction_emoji")?.OldValue;
public ForumPostSortOrder? DefaultSortOrder => (ForumPostSortOrder?)this.Changes.FirstOrDefault(x => x.Key == "default_sort_order")?.OldValue;
public ForumLayout? DefaultLayout => (ForumLayout?)this.Changes.FirstOrDefault(x => x.Key == "default_forum_layout")?.OldValue;
public int DefaultThreadPerUserRateLimit => (int)this.Changes.FirstOrDefault(x => x.Key == "default_thread_rate_limit_per_user")?.OldValue;
#endregion
}

0 comments on commit 08c0eee

Please sign in to comment.