From 409611852820066386e549731a5a2e14fc877b15 Mon Sep 17 00:00:00 2001 From: AnotherZane Date: Sun, 28 Jul 2024 23:41:41 +0530 Subject: [PATCH] Added extensions for tags --- .../Extensions/LocalChannelTagExtensions.cs | 35 +++++++++++++++++++ .../Guild/{Forums => }/LocalChannelTag.cs | 0 2 files changed, 35 insertions(+) create mode 100644 src/Disqord.Core/Entities/Local/Guild/Extensions/LocalChannelTagExtensions.cs rename src/Disqord.Core/Entities/Local/Guild/{Forums => }/LocalChannelTag.cs (100%) diff --git a/src/Disqord.Core/Entities/Local/Guild/Extensions/LocalChannelTagExtensions.cs b/src/Disqord.Core/Entities/Local/Guild/Extensions/LocalChannelTagExtensions.cs new file mode 100644 index 000000000..be408eaa2 --- /dev/null +++ b/src/Disqord.Core/Entities/Local/Guild/Extensions/LocalChannelTagExtensions.cs @@ -0,0 +1,35 @@ +using System.ComponentModel; + +namespace Disqord; + +[EditorBrowsable(EditorBrowsableState.Never)] +public static class LocalChannelTagExtensions +{ + public static TChannelTag WithId(this TChannelTag channelTag, Snowflake id) + where TChannelTag : LocalChannelTag + { + channelTag.Id = id; + return channelTag; + } + + public static TChannelTag WithName(this TChannelTag channelTag, string name) + where TChannelTag : LocalChannelTag + { + channelTag.Name = name; + return channelTag; + } + + public static TChannelTag WithIsModerated(this TChannelTag channelTag, bool isModerated = true) + where TChannelTag : LocalChannelTag + { + channelTag.IsModerated = isModerated; + return channelTag; + } + + public static TChannelTag WithEmoji(this TChannelTag channelTag, LocalEmoji emoji) + where TChannelTag : LocalChannelTag + { + channelTag.Emoji = emoji; + return channelTag; + } +} diff --git a/src/Disqord.Core/Entities/Local/Guild/Forums/LocalChannelTag.cs b/src/Disqord.Core/Entities/Local/Guild/LocalChannelTag.cs similarity index 100% rename from src/Disqord.Core/Entities/Local/Guild/Forums/LocalChannelTag.cs rename to src/Disqord.Core/Entities/Local/Guild/LocalChannelTag.cs