Fix/Implement various invite-related behaviors (#1023)
* Initial support for invite member count arg * Fix IDiscordClient#GetInviteAsync behavior - Previously, the GetInviteAsync method would return null since it couldn't be parsed as a simple RestInvite object. The object should be a RestInviteMetadata instead. * Fix methods that didn't comply with the interface * Change with_counts REST behaviour * Remove unnecessary JSON prop * Remove AcceptAsync
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Discord
|
||||
{
|
||||
@@ -22,8 +22,9 @@ namespace Discord
|
||||
ulong GuildId { get; }
|
||||
/// <summary> Gets the name of the guild this invite is linked to. </summary>
|
||||
string GuildName { get; }
|
||||
|
||||
/// <summary> Accepts this invite and joins the target guild. This will fail on bot accounts. </summary>
|
||||
Task AcceptAsync(RequestOptions options = null);
|
||||
/// <summary> Gets the approximated count of online members in the guild. </summary>
|
||||
int? PresenceCount { get; }
|
||||
/// <summary> Gets the approximated count of total members in the guild. </summary>
|
||||
int? MemberCount { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Discord
|
||||
Task<IReadOnlyCollection<IGuild>> GetGuildsAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
|
||||
Task<IGuild> CreateGuildAsync(string name, IVoiceRegion region, Stream jpegIcon = null, RequestOptions options = null);
|
||||
|
||||
Task<IInvite> GetInviteAsync(string inviteId, RequestOptions options = null);
|
||||
Task<IInvite> GetInviteAsync(string inviteId, bool withCount = false, RequestOptions options = null);
|
||||
|
||||
Task<IUser> GetUserAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
|
||||
Task<IUser> GetUserAsync(string username, string discriminator, RequestOptions options = null);
|
||||
|
||||
Reference in New Issue
Block a user