Skip to content

Commit

Permalink
codefix #1020: RequestOptions should always be sorted last
Browse files Browse the repository at this point in the history
  • Loading branch information
foxbot committed May 24, 2018
1 parent bf5275e commit 5023357
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/Discord.Net.Core/Entities/Guilds/IGuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ public interface IGuild : IDeletable, ISnowflakeEntity
Task<ITextChannel> GetDefaultChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
Task<IGuildChannel> GetEmbedChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
/// <summary> Creates a new text channel. </summary>
Task<ITextChannel> CreateTextChannelAsync(string name, RequestOptions options = null, Action<TextChannelProperties> func = null);
Task<ITextChannel> CreateTextChannelAsync(string name, Action<TextChannelProperties> func = null, RequestOptions options = null);
/// <summary> Creates a new voice channel. </summary>
Task<IVoiceChannel> CreateVoiceChannelAsync(string name, RequestOptions options = null, Action<VoiceChannelProperties> func = null);
Task<IVoiceChannel> CreateVoiceChannelAsync(string name, Action<VoiceChannelProperties> func = null, RequestOptions options = null);
/// <summary> Creates a new channel category. </summary>
Task<ICategoryChannel> CreateCategoryAsync(string name, RequestOptions options = null);

Expand Down
12 changes: 6 additions & 6 deletions src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,9 @@ public async Task<RestTextChannel> GetSystemChannelAsync(RequestOptions options
}
return null;
}
public Task<RestTextChannel> CreateTextChannelAsync(string name, RequestOptions options = null, Action<TextChannelProperties> func = null)
public Task<RestTextChannel> CreateTextChannelAsync(string name, Action<TextChannelProperties> func = null, RequestOptions options = null)
=> GuildHelper.CreateTextChannelAsync(this, Discord, name, options, func);
public Task<RestVoiceChannel> CreateVoiceChannelAsync(string name, RequestOptions options = null, Action<VoiceChannelProperties> func = null)
public Task<RestVoiceChannel> CreateVoiceChannelAsync(string name, Action<VoiceChannelProperties> func = null, RequestOptions options = null)
=> GuildHelper.CreateVoiceChannelAsync(this, Discord, name, options, func);
public Task<RestCategoryChannel> CreateCategoryChannelAsync(string name, RequestOptions options = null)
=> GuildHelper.CreateCategoryChannelAsync(this, Discord, name, options);
Expand Down Expand Up @@ -383,10 +383,10 @@ async Task<ITextChannel> IGuild.GetSystemChannelAsync(CacheMode mode, RequestOpt
else
return null;
}
async Task<ITextChannel> IGuild.CreateTextChannelAsync(string name, RequestOptions options, Action<TextChannelProperties> func)
=> await CreateTextChannelAsync(name, options, func).ConfigureAwait(false);
async Task<IVoiceChannel> IGuild.CreateVoiceChannelAsync(string name, RequestOptions options, Action<VoiceChannelProperties> func)
=> await CreateVoiceChannelAsync(name, options, func).ConfigureAwait(false);
async Task<ITextChannel> IGuild.CreateTextChannelAsync(string name, Action<TextChannelProperties> func, RequestOptions options)
=> await CreateTextChannelAsync(name, func, options).ConfigureAwait(false);
async Task<IVoiceChannel> IGuild.CreateVoiceChannelAsync(string name, Action<VoiceChannelProperties> func, RequestOptions options)
=> await CreateVoiceChannelAsync(name, func, options).ConfigureAwait(false);
async Task<ICategoryChannel> IGuild.CreateCategoryAsync(string name, RequestOptions options)
=> await CreateCategoryChannelAsync(name, options).ConfigureAwait(false);

Expand Down
12 changes: 6 additions & 6 deletions src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,9 @@ public SocketTextChannel GetTextChannel(ulong id)
=> GetChannel(id) as SocketTextChannel;
public SocketVoiceChannel GetVoiceChannel(ulong id)
=> GetChannel(id) as SocketVoiceChannel;
public Task<RestTextChannel> CreateTextChannelAsync(string name, RequestOptions options = null, Action<TextChannelProperties> func = null)
public Task<RestTextChannel> CreateTextChannelAsync(string name, Action<TextChannelProperties> func = null, RequestOptions options = null)
=> GuildHelper.CreateTextChannelAsync(this, Discord, name, options, func);
public Task<RestVoiceChannel> CreateVoiceChannelAsync(string name, RequestOptions options = null, Action<VoiceChannelProperties> func = null)
public Task<RestVoiceChannel> CreateVoiceChannelAsync(string name, Action<VoiceChannelProperties> func = null, RequestOptions options = null)
=> GuildHelper.CreateVoiceChannelAsync(this, Discord, name, options, func);
public Task<RestCategoryChannel> CreateCategoryChannelAsync(string name, RequestOptions options = null)
=> GuildHelper.CreateCategoryChannelAsync(this, Discord, name, options);
Expand Down Expand Up @@ -678,10 +678,10 @@ Task<IGuildChannel> IGuild.GetEmbedChannelAsync(CacheMode mode, RequestOptions o
=> Task.FromResult<IGuildChannel>(EmbedChannel);
Task<ITextChannel> IGuild.GetSystemChannelAsync(CacheMode mode, RequestOptions options)
=> Task.FromResult<ITextChannel>(SystemChannel);
async Task<ITextChannel> IGuild.CreateTextChannelAsync(string name, RequestOptions options, Action<TextChannelProperties> func)
=> await CreateTextChannelAsync(name, options, func).ConfigureAwait(false);
async Task<IVoiceChannel> IGuild.CreateVoiceChannelAsync(string name, RequestOptions options, Action<VoiceChannelProperties> func)
=> await CreateVoiceChannelAsync(name, options, func).ConfigureAwait(false);
async Task<ITextChannel> IGuild.CreateTextChannelAsync(string name, Action<TextChannelProperties> func, RequestOptions options)
=> await CreateTextChannelAsync(name, func, options).ConfigureAwait(false);
async Task<IVoiceChannel> IGuild.CreateVoiceChannelAsync(string name, Action<VoiceChannelProperties> func, RequestOptions options)
=> await CreateVoiceChannelAsync(name, func, options).ConfigureAwait(false);
async Task<ICategoryChannel> IGuild.CreateCategoryAsync(string name, RequestOptions options)
=> await CreateCategoryChannelAsync(name, options).ConfigureAwait(false);

Expand Down

0 comments on commit 5023357

Please sign in to comment.