Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve formatting of ApplicationCommandServiceHostExtensions
Browse files Browse the repository at this point in the history
KubaZ2 committed Nov 18, 2024
1 parent f20b0d2 commit 6697f65
Showing 1 changed file with 56 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -59,7 +59,16 @@ public static IHost AddSlashCommand(this IHost host,
ulong? guildId = null)
{
var service = ServiceProviderServiceHelper.GetSingle<IApplicationCommandService>(host.Services);
service.AddSlashCommand(name, description, handler, defaultGuildUserPermissions, dMPermission, defaultPermission, integrationTypes, contexts, nsfw, guildId);
service.AddSlashCommand(name,
description,
handler,
defaultGuildUserPermissions,
dMPermission,
defaultPermission,
integrationTypes,
contexts,
nsfw,
guildId);
return host;
}

@@ -75,7 +84,15 @@ public static IHost AddUserCommand(this IHost host,
ulong? guildId = null)
{
var service = ServiceProviderServiceHelper.GetSingle<IApplicationCommandService>(host.Services);
service.AddUserCommand(name, handler, defaultGuildUserPermissions, dMPermission, defaultPermission, integrationTypes, contexts, nsfw, guildId);
service.AddUserCommand(name,
handler,
defaultGuildUserPermissions,
dMPermission,
defaultPermission,
integrationTypes,
contexts,
nsfw,
guildId);
return host;
}

@@ -91,7 +108,15 @@ public static IHost AddMessageCommand(this IHost host,
ulong? guildId = null)
{
var service = ServiceProviderServiceHelper.GetSingle<IApplicationCommandService>(host.Services);
service.AddMessageCommand(name, handler, defaultGuildUserPermissions, dMPermission, defaultPermission, integrationTypes, contexts, nsfw, guildId);
service.AddMessageCommand(name,
handler,
defaultGuildUserPermissions,
dMPermission,
defaultPermission,
integrationTypes,
contexts,
nsfw,
guildId);
return host;
}

@@ -108,7 +133,16 @@ public static IHost AddSlashCommand<TContext>(this IHost host,
ulong? guildId = null) where TContext : IApplicationCommandContext
{
var service = host.Services.GetRequiredService<ApplicationCommandService<TContext>>();
service.AddSlashCommand(name, description, handler, defaultGuildUserPermissions, dMPermission, defaultPermission, integrationTypes, contexts, nsfw, guildId);
service.AddSlashCommand(name,
description,
handler,
defaultGuildUserPermissions,
dMPermission,
defaultPermission,
integrationTypes,
contexts,
nsfw,
guildId);
return host;
}

@@ -124,7 +158,15 @@ public static IHost AddUserCommand<TContext>(this IHost host,
ulong? guildId = null) where TContext : IApplicationCommandContext
{
var service = host.Services.GetRequiredService<ApplicationCommandService<TContext>>();
service.AddUserCommand(name, handler, defaultGuildUserPermissions, dMPermission, defaultPermission, integrationTypes, contexts, nsfw, guildId);
service.AddUserCommand(name,
handler,
defaultGuildUserPermissions,
dMPermission,
defaultPermission,
integrationTypes,
contexts,
nsfw,
guildId);
return host;
}

@@ -140,7 +182,15 @@ public static IHost AddMessageCommand<TContext>(this IHost host,
ulong? guildId = null) where TContext : IApplicationCommandContext
{
var service = host.Services.GetRequiredService<ApplicationCommandService<TContext>>();
service.AddMessageCommand(name, handler, defaultGuildUserPermissions, dMPermission, defaultPermission, integrationTypes, contexts, nsfw, guildId);
service.AddMessageCommand(name,
handler,
defaultGuildUserPermissions,
dMPermission,
defaultPermission,
integrationTypes,
contexts,
nsfw,
guildId);
return host;
}
}

0 comments on commit 6697f65

Please sign in to comment.