Port the DM stuff

This commit is contained in:
Ske
2020-12-25 13:58:45 +01:00
parent a2c8cbb560
commit 9079f1c59c
15 changed files with 95 additions and 77 deletions

View File

@@ -6,6 +6,7 @@ using System.Text;
using System.Threading.Tasks;
using Myriad.Rest.Exceptions;
using Myriad.Types;
using Newtonsoft.Json;
@@ -140,14 +141,14 @@ namespace PluralKit.Bot
try
{
var dm = await ctx.Rest.CreateDmAsync(ctx.Author.Id);
var dm = await ctx.Rest.CreateDmAsync(ctx.AuthorNew.Id);
// TODO: send file
var msg = await dm.SendFileAsync("system.json", stream, $"{Emojis.Success} Here you go!");
await dm.SendMessageAsync($"<{msg.Attachments[0].Url}>");
// If the original message wasn't posted in DMs, send a public reminder
// TODO: DMs
// if (!(ctx.Channel is DiscordDmChannel))
// await ctx.Reply($"{Emojis.Success} Check your DMs!");
if (ctx.ChannelNew.Type == Channel.ChannelType.Dm)
await ctx.Reply($"{Emojis.Success} Check your DMs!");
}
catch (UnauthorizedException)
{