A few more renames
This commit is contained in:
@@ -162,7 +162,7 @@ namespace Discord
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Destroys the provided channel. </summary>
|
/// <summary> Destroys the provided channel. </summary>
|
||||||
public async Task DestroyChannel(Channel channel)
|
public async Task DeleteChannel(Channel channel)
|
||||||
{
|
{
|
||||||
if (channel == null) throw new ArgumentNullException(nameof(channel));
|
if (channel == null) throw new ArgumentNullException(nameof(channel));
|
||||||
CheckReady();
|
CheckReady();
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ namespace Discord
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Deletes the provided invite. </summary>
|
/// <summary> Deletes the provided invite. </summary>
|
||||||
public async Task DestroyInvite(Invite invite)
|
public async Task DeleteInvite(Invite invite)
|
||||||
{
|
{
|
||||||
if (invite == null) throw new ArgumentNullException(nameof(invite));
|
if (invite == null) throw new ArgumentNullException(nameof(invite));
|
||||||
CheckReady();
|
CheckReady();
|
||||||
|
|||||||
@@ -239,7 +239,7 @@ namespace Discord
|
|||||||
|
|
||||||
private Task MessageQueueLoop()
|
private Task MessageQueueLoop()
|
||||||
{
|
{
|
||||||
var cancelToken = CancelToken;
|
var cancelToken = _cancelToken;
|
||||||
int interval = Config.MessageQueueInterval;
|
int interval = Config.MessageQueueInterval;
|
||||||
|
|
||||||
return Task.Run(async () =>
|
return Task.Run(async () =>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ namespace Discord
|
|||||||
{
|
{
|
||||||
public partial class DiscordClient
|
public partial class DiscordClient
|
||||||
{
|
{
|
||||||
public Task SetChannelUserPermissions(Channel channel, User user, ChannelPermissions allow = null, ChannelPermissions deny = null)
|
public Task SetChannelPermissions(Channel channel, User user, ChannelPermissions allow = null, ChannelPermissions deny = null)
|
||||||
{
|
{
|
||||||
if (channel == null) throw new ArgumentNullException(nameof(channel));
|
if (channel == null) throw new ArgumentNullException(nameof(channel));
|
||||||
if (user == null) throw new ArgumentNullException(nameof(user));
|
if (user == null) throw new ArgumentNullException(nameof(user));
|
||||||
@@ -15,7 +15,7 @@ namespace Discord
|
|||||||
|
|
||||||
return SetChannelPermissions(channel, user?.Id, PermissionTarget.User, allow, deny);
|
return SetChannelPermissions(channel, user?.Id, PermissionTarget.User, allow, deny);
|
||||||
}
|
}
|
||||||
public Task SetChannelUserPermissions(Channel channel, User user, DualChannelPermissions permissions = null)
|
public Task SetChannelPermissions(Channel channel, User user, DualChannelPermissions permissions = null)
|
||||||
{
|
{
|
||||||
if (channel == null) throw new ArgumentNullException(nameof(channel));
|
if (channel == null) throw new ArgumentNullException(nameof(channel));
|
||||||
if (user == null) throw new ArgumentNullException(nameof(user));
|
if (user == null) throw new ArgumentNullException(nameof(user));
|
||||||
@@ -23,7 +23,7 @@ namespace Discord
|
|||||||
|
|
||||||
return SetChannelPermissions(channel, user?.Id, PermissionTarget.User, permissions?.Allow, permissions?.Deny);
|
return SetChannelPermissions(channel, user?.Id, PermissionTarget.User, permissions?.Allow, permissions?.Deny);
|
||||||
}
|
}
|
||||||
public Task SetChannelRolePermissions(Channel channel, Role role, ChannelPermissions allow = null, ChannelPermissions deny = null)
|
public Task SetChannelPermissions(Channel channel, Role role, ChannelPermissions allow = null, ChannelPermissions deny = null)
|
||||||
{
|
{
|
||||||
if (channel == null) throw new ArgumentNullException(nameof(channel));
|
if (channel == null) throw new ArgumentNullException(nameof(channel));
|
||||||
if (role == null) throw new ArgumentNullException(nameof(role));
|
if (role == null) throw new ArgumentNullException(nameof(role));
|
||||||
@@ -31,7 +31,7 @@ namespace Discord
|
|||||||
|
|
||||||
return SetChannelPermissions(channel, role?.Id, PermissionTarget.Role, allow, deny);
|
return SetChannelPermissions(channel, role?.Id, PermissionTarget.Role, allow, deny);
|
||||||
}
|
}
|
||||||
public Task SetChannelRolePermissions(Channel channel, Role role, DualChannelPermissions permissions = null)
|
public Task SetChannelPermissions(Channel channel, Role role, DualChannelPermissions permissions = null)
|
||||||
{
|
{
|
||||||
if (channel == null) throw new ArgumentNullException(nameof(channel));
|
if (channel == null) throw new ArgumentNullException(nameof(channel));
|
||||||
if (role == null) throw new ArgumentNullException(nameof(role));
|
if (role == null) throw new ArgumentNullException(nameof(role));
|
||||||
@@ -42,7 +42,7 @@ namespace Discord
|
|||||||
private Task SetChannelPermissions(Channel channel, string targetId, PermissionTarget targetType, ChannelPermissions allow = null, ChannelPermissions deny = null)
|
private Task SetChannelPermissions(Channel channel, string targetId, PermissionTarget targetType, ChannelPermissions allow = null, ChannelPermissions deny = null)
|
||||||
=> _api.SetChannelPermissions(channel.Id, targetId, targetType.Value, allow?.RawValue ?? 0, deny?.RawValue ?? 0);
|
=> _api.SetChannelPermissions(channel.Id, targetId, targetType.Value, allow?.RawValue ?? 0, deny?.RawValue ?? 0);
|
||||||
|
|
||||||
public Task RemoveChannelUserPermissions(Channel channel, User user)
|
public Task RemoveChannelPermissions(Channel channel, User user)
|
||||||
{
|
{
|
||||||
if (channel == null) throw new ArgumentNullException(nameof(channel));
|
if (channel == null) throw new ArgumentNullException(nameof(channel));
|
||||||
if (user == null) throw new ArgumentNullException(nameof(user));
|
if (user == null) throw new ArgumentNullException(nameof(user));
|
||||||
@@ -50,7 +50,7 @@ namespace Discord
|
|||||||
|
|
||||||
return RemoveChannelPermissions(channel, user?.Id, PermissionTarget.User);
|
return RemoveChannelPermissions(channel, user?.Id, PermissionTarget.User);
|
||||||
}
|
}
|
||||||
public Task RemoveChannelRolePermissions(Channel channel, Role role)
|
public Task RemoveChannelPermissions(Channel channel, Role role)
|
||||||
{
|
{
|
||||||
if (channel == null) throw new ArgumentNullException(nameof(channel));
|
if (channel == null) throw new ArgumentNullException(nameof(channel));
|
||||||
if (role == null) throw new ArgumentNullException(nameof(role));
|
if (role == null) throw new ArgumentNullException(nameof(role));
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ namespace Discord
|
|||||||
|
|
||||||
this.Connected += async (s, e) =>
|
this.Connected += async (s, e) =>
|
||||||
{
|
{
|
||||||
_api.CancelToken = CancelToken;
|
_api.CancelToken = _cancelToken;
|
||||||
await SendStatus().ConfigureAwait(false);
|
await SendStatus().ConfigureAwait(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ namespace Discord
|
|||||||
|
|
||||||
public CancellationToken CancelToken => _cancelToken;
|
public CancellationToken CancelToken => _cancelToken;
|
||||||
private CancellationTokenSource _cancelTokenSource;
|
private CancellationTokenSource _cancelTokenSource;
|
||||||
private CancellationToken _cancelToken;
|
protected CancellationToken _cancelToken;
|
||||||
|
|
||||||
/// <summary> Initializes a new instance of the DiscordClient class. </summary>
|
/// <summary> Initializes a new instance of the DiscordClient class. </summary>
|
||||||
public DiscordWSClient(DiscordWSClientConfig config = null)
|
public DiscordWSClient(DiscordWSClientConfig config = null)
|
||||||
@@ -309,7 +309,7 @@ namespace Discord
|
|||||||
{
|
{
|
||||||
string token = e.Payload.Value<string>("token");
|
string token = e.Payload.Value<string>("token");
|
||||||
_voiceSocket.Host = "wss://" + e.Payload.Value<string>("endpoint").Split(':')[0];
|
_voiceSocket.Host = "wss://" + e.Payload.Value<string>("endpoint").Split(':')[0];
|
||||||
await _voiceSocket.Login(_userId, _dataSocket.SessionId, token, CancelToken).ConfigureAwait(false);
|
await _voiceSocket.Login(_userId, _dataSocket.SessionId, token, _cancelToken).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ namespace Discord.Tests
|
|||||||
|
|
||||||
AssertEvent<ChannelEventArgs>(
|
AssertEvent<ChannelEventArgs>(
|
||||||
"ChannelDestroyed event never received",
|
"ChannelDestroyed event never received",
|
||||||
async () => await _hostClient.DestroyChannel(channel),
|
async () => await _hostClient.DeleteChannel(channel),
|
||||||
x => _targetBot.ChannelDestroyed += x,
|
x => _targetBot.ChannelDestroyed += x,
|
||||||
x => _targetBot.ChannelDestroyed -= x,
|
x => _targetBot.ChannelDestroyed -= x,
|
||||||
(s, e) => e.Channel.Name == name);
|
(s, e) => e.Channel.Name == name);
|
||||||
|
|||||||
Reference in New Issue
Block a user