Fixed some legacy warnings

This commit is contained in:
RogueException
2015-12-23 14:29:37 -04:00
parent 8429a52bc5
commit ecee1b721c

View File

@@ -346,49 +346,49 @@ namespace Discord.Legacy
public static IEnumerable<Region> GetVoiceRegions(this DiscordClient client)
=> client.Regions;
[Obsolete("Use Channel.GetPermissions")]
[Obsolete("Use Channel.GetPermissionRule")]
public static DualChannelPermissions GetChannelPermissions(this DiscordClient client, Channel channel, User user)
{
if (channel == null) throw new ArgumentNullException(nameof(channel));
return channel.GetPermissionsRule(user);
}
[Obsolete("Use Channel.GetPermissions")]
[Obsolete("Use Channel.GetPermissionRule")]
public static DualChannelPermissions GetChannelPermissions(this DiscordClient client, Channel channel, Role role)
{
if (channel == null) throw new ArgumentNullException(nameof(channel));
return channel.GetPermissionsRule(role);
}
[Obsolete("Use Channel.SetPermissions")]
[Obsolete("Use Channel.AddPermissionRule")]
public static Task SetChannelPermissions(this DiscordClient client, Channel channel, User user, ChannelPermissions allow = null, ChannelPermissions deny = null)
{
if (channel == null) throw new ArgumentNullException(nameof(channel));
return channel.AddPermissionsRule(user, allow, deny);
}
[Obsolete("Use Channel.SetPermissions")]
[Obsolete("Use Channel.AddPermissionRule")]
public static Task SetChannelPermissions(this DiscordClient client, Channel channel, User user, DualChannelPermissions permissions = null)
{
if (channel == null) throw new ArgumentNullException(nameof(channel));
return channel.AddPermissionsRule(user, permissions);
}
[Obsolete("Use Channel.SetPermissions")]
[Obsolete("Use Channel.AddPermissionRule")]
public static Task SetChannelPermissions(this DiscordClient client, Channel channel, Role role, ChannelPermissions allow = null, ChannelPermissions deny = null)
{
if (channel == null) throw new ArgumentNullException(nameof(channel));
return channel.AddPermissionsRule(role, allow, deny);
}
[Obsolete("Use Channel.SetPermissions")]
[Obsolete("Use Channel.AddPermissionRule")]
public static Task SetChannelPermissions(this DiscordClient client, Channel channel, Role role, DualChannelPermissions permissions = null)
{
if (channel == null) throw new ArgumentNullException(nameof(channel));
return channel.AddPermissionsRule(role, permissions);
}
[Obsolete("Use Channel.RemovePermissions")]
[Obsolete("Use Channel.RemovePermissionRule")]
public static Task RemoveChannelPermissions(this DiscordClient client, Channel channel, User user)
{
if (channel == null) throw new ArgumentNullException(nameof(channel));
return channel.RemovePermissionsRule(user);
}
[Obsolete("Use Channel.RemovePermissions")]
[Obsolete("Use Channel.RemovePermissionRule")]
public static Task RemoveChannelPermissions(this DiscordClient client, Channel channel, Role role)
{
if (channel == null) throw new ArgumentNullException(nameof(channel));