Converted enough to send the system card

This commit is contained in:
Ske
2020-12-22 16:55:13 +01:00
parent a6fbd869be
commit 05334f0d25
28 changed files with 343 additions and 198 deletions

View File

@@ -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;