Port the DM stuff
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
@@ -73,7 +73,7 @@ namespace PluralKit.Bot
|
||||
public async Task ViewMember(Context ctx, PKMember target)
|
||||
{
|
||||
var system = await _db.Execute(c => _repo.GetSystem(c, target.System));
|
||||
await ctx.Reply(embed: await _embeds.CreateMemberEmbed(system, target, ctx.Guild, ctx.LookupContextFor(system)));
|
||||
await ctx.Reply(embed: await _embeds.CreateMemberEmbed(system, target, ctx.GuildNew, ctx.LookupContextFor(system)));
|
||||
}
|
||||
|
||||
public async Task Soulscream(Context ctx, PKMember target)
|
||||
|
@@ -228,7 +228,7 @@ namespace PluralKit.Bot {
|
||||
var message = await _db.Execute(c => _repo.GetMessage(c, messageId));
|
||||
if (message == null) throw Errors.MessageNotFound(messageId);
|
||||
|
||||
await ctx.Reply(embed: await _embeds.CreateMessageInfoEmbed(ctx.Shard, message));
|
||||
await ctx.Reply(embed: await _embeds.CreateMessageInfoEmbed(message));
|
||||
}
|
||||
}
|
||||
}
|
@@ -38,7 +38,7 @@ namespace PluralKit.Bot
|
||||
throw new PKError("Your system has no members! Please create at least one member before using this command.");
|
||||
|
||||
var randInt = randGen.Next(members.Count);
|
||||
await ctx.Reply(embed: await _embeds.CreateMemberEmbed(ctx.System, members[randInt], ctx.Guild, ctx.LookupContextFor(ctx.System)));
|
||||
await ctx.Reply(embed: await _embeds.CreateMemberEmbed(ctx.System, members[randInt], ctx.GuildNew, ctx.LookupContextFor(ctx.System)));
|
||||
}
|
||||
|
||||
public async Task Group(Context ctx)
|
||||
@@ -73,7 +73,7 @@ namespace PluralKit.Bot
|
||||
var ms = members.ToList();
|
||||
|
||||
var randInt = randGen.Next(ms.Count);
|
||||
await ctx.Reply(embed: await _embeds.CreateMemberEmbed(ctx.System, ms[randInt], ctx.Guild, ctx.LookupContextFor(ctx.System)));
|
||||
await ctx.Reply(embed: await _embeds.CreateMemberEmbed(ctx.System, ms[randInt], ctx.GuildNew, ctx.LookupContextFor(ctx.System)));
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user