mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
Converted enough to send the system card
This commit is contained in:
parent
a6fbd869be
commit
05334f0d25
28 changed files with 343 additions and 198 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue