2021-08-27 11:03:47 -04:00
|
|
|
using Myriad.Types;
|
2020-12-22 16:55:13 +01:00
|
|
|
|
2021-11-26 21:10:56 -05:00
|
|
|
namespace Myriad.Extensions;
|
|
|
|
|
|
|
|
public static class ChannelExtensions
|
2020-12-22 13:15:26 +01:00
|
|
|
{
|
2021-11-26 21:10:56 -05:00
|
|
|
public static string Mention(this Channel channel) => $"<#{channel.Id}>";
|
2021-07-15 12:41:19 +02:00
|
|
|
|
2021-11-26 21:10:56 -05:00
|
|
|
public static bool IsThread(this Channel channel) => channel.Type.IsThread();
|
2021-07-15 12:41:19 +02:00
|
|
|
|
2021-11-26 21:10:56 -05:00
|
|
|
public static bool IsThread(this Channel.ChannelType type) =>
|
|
|
|
type is Channel.ChannelType.GuildPublicThread
|
|
|
|
or Channel.ChannelType.GuildPrivateThread
|
|
|
|
or Channel.ChannelType.GuildNewsThread;
|
2020-12-22 13:15:26 +01:00
|
|
|
}
|