Added remaining gateway events, added IAudioChannel, added CacheModes

This commit is contained in:
RogueException
2016-10-04 07:32:26 -03:00
parent e038475ab4
commit 4678544fed
58 changed files with 1685 additions and 855 deletions

View File

@@ -1,4 +1,5 @@
using System.Diagnostics;
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using Model = Discord.API.User;
@@ -42,10 +43,13 @@ namespace Discord.Rest
public virtual async Task UpdateAsync()
=> Update(await UserHelper.GetAsync(this, Discord));
public Task<IDMChannel> CreateDMChannelAsync()
public Task<RestDMChannel> CreateDMChannelAsync()
=> UserHelper.CreateDMChannelAsync(this, Discord);
IDMChannel IUser.GetCachedDMChannel() => null;
Task<IDMChannel> IUser.GetDMChannelAsync(CacheMode mode)
=> Task.FromResult<IDMChannel>(null);
async Task<IDMChannel> IUser.CreateDMChannelAsync()
=> await CreateDMChannelAsync();
}
}

View File

@@ -44,7 +44,7 @@ namespace Discord.Rest
await client.ApiClient.RemoveGuildMemberAsync(user.GuildId, user.Id);
}
public static async Task<IDMChannel> CreateDMChannelAsync(IUser user, BaseDiscordClient client)
public static async Task<RestDMChannel> CreateDMChannelAsync(IUser user, BaseDiscordClient client)
{
var args = new CreateDMChannelParams(user.Id);
return RestDMChannel.Create(client, await client.ApiClient.CreateDMChannelAsync(args));