Skip to content

Commit

Permalink
Added extensions for tags
Browse files Browse the repository at this point in the history
  • Loading branch information
AnotherZane committed Jul 28, 2024
1 parent 4a2f70f commit 4096118
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System.ComponentModel;

namespace Disqord;

[EditorBrowsable(EditorBrowsableState.Never)]
public static class LocalChannelTagExtensions
{
public static TChannelTag WithId<TChannelTag>(this TChannelTag channelTag, Snowflake id)
where TChannelTag : LocalChannelTag
{
channelTag.Id = id;
return channelTag;
}

public static TChannelTag WithName<TChannelTag>(this TChannelTag channelTag, string name)
where TChannelTag : LocalChannelTag
{
channelTag.Name = name;
return channelTag;
}

public static TChannelTag WithIsModerated<TChannelTag>(this TChannelTag channelTag, bool isModerated = true)
where TChannelTag : LocalChannelTag
{
channelTag.IsModerated = isModerated;
return channelTag;
}

public static TChannelTag WithEmoji<TChannelTag>(this TChannelTag channelTag, LocalEmoji emoji)
where TChannelTag : LocalChannelTag
{
channelTag.Emoji = emoji;
return channelTag;
}
}

0 comments on commit 4096118

Please sign in to comment.