Added CommandContext, fixed commands compile errors

This commit is contained in:
RogueException
2016-10-04 09:54:44 -03:00
parent 8aa1050b93
commit 708f9fe514
32 changed files with 187 additions and 148 deletions

View File

@@ -16,24 +16,25 @@ namespace Discord.Rest
public IReadOnlyCollection<Overwrite> PermissionOverwrites => _overwrites;
public ulong GuildId { get; }
internal IGuild Guild { get; }
public ulong GuildId => Guild.Id;
public string Name { get; private set; }
public int Position { get; private set; }
internal RestGuildChannel(BaseDiscordClient discord, ulong id, ulong guildId)
internal RestGuildChannel(BaseDiscordClient discord, IGuild guild, ulong id)
: base(discord, id)
{
GuildId = guildId;
Guild = guild;
}
internal new static RestGuildChannel Create(BaseDiscordClient discord, Model model)
internal static RestGuildChannel Create(BaseDiscordClient discord, IGuild guild, Model model)
{
switch (model.Type)
{
case ChannelType.Text:
return RestTextChannel.Create(discord, model);
return RestTextChannel.Create(discord, guild, model);
case ChannelType.Voice:
return RestVoiceChannel.Create(discord, model);
return RestVoiceChannel.Create(discord, guild, model);
default:
throw new InvalidOperationException("Unknown guild channel type");
}