Skip to content
Permalink
Browse files

Fix missing "Async" suffixes.

  • Loading branch information
Trojaner committed Mar 18, 2019
1 parent 5aecbcd commit 7816daf7930a1221511f1b181262011de0a26c65
@@ -95,6 +95,6 @@ public interface ICommandContext
/// <summary>
/// Sends the command usage to the user.
/// </summary>
Task SendCommandUsage();
Task SendCommandUsageAsync();
}
}
@@ -18,6 +18,6 @@ public interface IEventListener<in TEvent> : IEventListener where TEvent : IEven
/// </summary>
/// <param name="emitter">The event emitter.</param>
/// <param name="event">The event instance.</param>
Task HandleEvent(IEventEmitter emitter, TEvent @event);
Task HandleEventAsync(IEventEmitter emitter, TEvent @event);
}
}
@@ -39,7 +39,7 @@ public class CommandContext : ICommandContext
public ICommandParameters Parameters { get; }
public IDependencyContainer Container { get; }

public async Task SendCommandUsage()
public async Task SendCommandUsageAsync()
{
await User.SendMessageAsync("Usage: " + CommandPrefix + CommandAlias + " " + Command.Syntax, Color.Blue);
}
@@ -39,7 +39,7 @@ public class CommandWrongUsageException : Exception, ICommandFriendlyException
public virtual async Task SendErrorMessageAsync(ICommandContext context)
{
await context.User.SendMessageAsync(Message, Color.DarkRed);
context.SendCommandUsage();
await context.SendCommandUsageAsync();
}
}
}
@@ -30,7 +30,7 @@ public async Task ExecuteAsync(ICommandContext context)
if (context.Parameters.Length == 0)
{
await context.User.SendMessageAsync(GetConfigTypes(configProviders));
await context.SendCommandUsage();
await context.SendCommandUsageAsync();
return;
}

@@ -63,10 +63,10 @@ public async Task ExecuteAsync(ICommandContext context)
return;
}

await UpdateGroup(context.User, configPermissions, targetPlayer, groupToUpdate);
await UpdateGroupAsync(context.User, configPermissions, targetPlayer, groupToUpdate);
}

protected abstract Task UpdateGroup(IUser user, IPermissionProvider permissions,
protected abstract Task UpdateGroupAsync(IUser user, IPermissionProvider permissions,
IUser targetUser, IPermissionGroup groupToUpdate);
}

@@ -77,7 +77,7 @@ public class CommandGroupAdd : CommandGroupUpdate
public override string Permission => "Rocket.Permissions.ManageGroups.Add";
public override string[] Aliases => new[] { "a", "+" };

protected override async Task UpdateGroup(IUser user, IPermissionProvider permissions,
protected override async Task UpdateGroupAsync(IUser user, IPermissionProvider permissions,
IUser targetUser, IPermissionGroup groupToUpdate)
{
if (await permissions.AddGroupAsync(targetUser, groupToUpdate))
@@ -95,7 +95,7 @@ public class CommandGroupRemove : CommandGroupUpdate
public override string Permission => "Rocket.Permissions.ManageGroups.Remove";
public override string[] Aliases => new[] { "r", "-" };

protected override async Task UpdateGroup(IUser user, IPermissionProvider permissions,
protected override async Task UpdateGroupAsync(IUser user, IPermissionProvider permissions,
IUser targetUser, IPermissionGroup groupToUpdate)
{
if (await permissions.RemoveGroupAsync(targetUser, groupToUpdate))
@@ -17,7 +17,7 @@ public static class LocalizationExtensions
/// <param name="translationKey">The translation key.</param>
/// <param name="color">The color to use.</param>
/// <param name="arguments">The arguments for the message. See <see cref="string.Format(string, object[])" /></param>
public static async Task SendLocalizedMessage(this IUser user, ITranslationCollection translations,
public static async Task SendLocalizedMessageAsync(this IUser user, ITranslationCollection translations,
string translationKey, Color? color = null, params object[] arguments)
{
await user.SendMessageAsync(await translations.GetAsync(translationKey, arguments), color);
@@ -30,7 +30,7 @@ public static class LocalizationExtensions
/// <param name="translations">The translations source.</param>
/// <param name="translationKey">The translation key.</param>
/// <param name="arguments">The arguments for the message. See <see cref="string.Format(string, object[])" /></param>
public static async Task SendLocalizedMessage(this IUser user, ITranslationCollection translations,
public static async Task SendLocalizedMessageAsync(this IUser user, ITranslationCollection translations,
string translationKey, params object[] arguments)
{
await user.SendMessageAsync(await translations.GetAsync(translationKey, arguments));
@@ -45,7 +45,7 @@ public static class LocalizationExtensions
/// <param name="translationKey">The translation key.</param>
/// <param name="color">The color to use.</param>
/// <param name="arguments">The arguments for the message.</param>
public static async Task SendLocalizedMessage(this IUserManager userManager, ITranslationCollection translations,
public static async Task SendLocalizedMessageAsync(this IUserManager userManager, ITranslationCollection translations,
IUser user, string translationKey, Color? color = null, params object[] arguments)
{
await userManager.SendMessageAsync(user, await translations.GetAsync(translationKey, arguments), color);
@@ -59,7 +59,7 @@ public static class LocalizationExtensions
/// <param name="user">The message receiver.</param>
/// <param name="translationKey">The translation key.</param>
/// <param name="arguments">The arguments for the message.</param>
public static async Task SendLocalizedMessage(this IUserManager userManager, ITranslationCollection translations,
public static async Task SendLocalizedMessageAsync(this IUserManager userManager, ITranslationCollection translations,
IUser user, string translationKey, params object[] arguments)
{
await userManager.SendMessageAsync(user, await translations.GetAsync(translationKey, arguments));
@@ -195,7 +195,7 @@ public virtual async Task<IEnumerable<SourcePackageDependencyInfo>> GetDependenc
var sourceRepositories = sourceRepositoryProvider.GetRepositories();

var availablePackages = new HashSet<SourcePackageDependencyInfo>(PackageIdentityComparer.Default);
await GetPackageDependencies(identity, cacheContext, sourceRepositories, availablePackages);
await GetPackageDependenciesAsync(identity, cacheContext, sourceRepositories, availablePackages);

var resolverContext = new PackageResolverContext(
DependencyBehavior.Lowest,
@@ -342,7 +342,7 @@ public virtual string GetNugetPackageFile(PackageIdentity identity)
return Path.Combine(dir, dirName + ".nupkg");
}

protected virtual async Task GetPackageDependencies(PackageIdentity package,
protected virtual async Task GetPackageDependenciesAsync(PackageIdentity package,
SourceCacheContext cacheContext,
IEnumerable<SourceRepository> repositories,
ISet<SourcePackageDependencyInfo> availablePackages)
@@ -374,7 +374,7 @@ public virtual string GetNugetPackageFile(PackageIdentity identity)
availablePackages.Add(dependencyInfo);
foreach (var dependency in dependencyInfo.Dependencies)
{
await GetPackageDependencies(
await GetPackageDependenciesAsync(
new PackageIdentity(dependency.Id, dependency.VersionRange.MaxVersion ?? dependency.VersionRange.MinVersion), cacheContext, repos, availablePackages);
}
}

0 comments on commit 7816daf

Please sign in to comment.
You can’t perform that action at this time.