Converted enough to send the system card
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
using DSharpPlus;
|
||||
using DSharpPlus.Entities;
|
||||
|
||||
using Myriad.Types;
|
||||
|
||||
using PluralKit.Bot.Utils;
|
||||
using PluralKit.Core;
|
||||
|
||||
@@ -153,13 +155,16 @@ namespace PluralKit.Bot
|
||||
return $"Group not found. Note that a group ID is 5 characters long.";
|
||||
}
|
||||
|
||||
public static async Task<DiscordChannel> MatchChannel(this Context ctx)
|
||||
public static async Task<Channel> MatchChannel(this Context ctx)
|
||||
{
|
||||
if (!MentionUtils.TryParseChannel(ctx.PeekArgument(), out var id))
|
||||
return null;
|
||||
|
||||
if (!ctx.Cache.TryGetChannel(id, out var channel))
|
||||
return null;
|
||||
|
||||
var channel = await ctx.Shard.GetChannel(id);
|
||||
if (channel == null || !(channel.Type == ChannelType.Text || channel.Type == ChannelType.News)) return null;
|
||||
if (!(channel.Type == Channel.ChannelType.GuildText || channel.Type == Channel.ChannelType.GuildText))
|
||||
return null;
|
||||
|
||||
ctx.PopArgument();
|
||||
return channel;
|
||||
|
||||
Reference in New Issue
Block a user