feature: Add inline replies (#1659)
* Add inline replies * Missed a few things * Change xml docs, IUserMessage, and other changes * Missed one when changing * Fix referencedMessage author
This commit is contained in:
@@ -6,6 +6,7 @@ using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using Model = Discord.API.Message;
|
||||
using UserModel = Discord.API.User;
|
||||
|
||||
namespace Discord.Rest
|
||||
{
|
||||
@@ -290,7 +291,7 @@ namespace Discord.Rest
|
||||
|
||||
public static MessageSource GetSource(Model msg)
|
||||
{
|
||||
if (msg.Type != MessageType.Default)
|
||||
if (msg.Type != MessageType.Default && msg.Type != MessageType.Reply)
|
||||
return MessageSource.System;
|
||||
else if (msg.WebhookId.IsSpecified)
|
||||
return MessageSource.Webhook;
|
||||
@@ -307,5 +308,15 @@ namespace Discord.Rest
|
||||
{
|
||||
await client.ApiClient.CrosspostAsync(channelId, msgId, options).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public static IUser GetAuthor(BaseDiscordClient client, IGuild guild, UserModel model, ulong? webhookId)
|
||||
{
|
||||
IUser author = null;
|
||||
if (guild != null)
|
||||
author = guild.GetUserAsync(model.Id, CacheMode.CacheOnly).Result;
|
||||
if (author == null)
|
||||
author = RestUser.Create(client, guild, model, webhookId);
|
||||
return author;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user