diff --git a/docs/content/contributing/_category_.yml b/docs/content/contributing/_category_.yml index 9989852..a86ae05 100644 --- a/docs/content/contributing/_category_.yml +++ b/docs/content/contributing/_category_.yml @@ -1,4 +1,4 @@ label: 'Contributing' position: 99 -collapsible: false +collapsible: true collapsed: false diff --git a/docs/content/interceptors/_category_.yml b/docs/content/interceptors/_category_.yml new file mode 100644 index 0000000..7c0cca3 --- /dev/null +++ b/docs/content/interceptors/_category_.yml @@ -0,0 +1,4 @@ +label: 'Interceptors' +position: 7 +collapsible: true +collapsed: true diff --git a/docs/content/interceptors/defer-interceptor.md b/docs/content/interceptors/defer-interceptor.md new file mode 100644 index 0000000..317d577 --- /dev/null +++ b/docs/content/interceptors/defer-interceptor.md @@ -0,0 +1,33 @@ +--- +id: defer-interceptor + +title: Defer command + +sidebar_position: 1 +--- + +Interceptor added `interaction.deferReply()` to the beiginning of the code + +## Usage + +```typescript +import { + Context, + SlashCommand, + SlashCommandContext, + DeferCommandInterceptor, +} from '@globalart/nestcord'; + +@Injectable() +export class AppService { + @UseInterceptors(DeferCommandInterceptor) + @SlashCommand({ + name: 'ping', + description: 'pong', + }) + async execute(@Context() [interaction]: SlashCommandContext) { + setTimeout(() => interaction.followUp({ content: 'Pong!' }), 5000); + } +} + +``` diff --git a/docs/content/recipes/_category_.yml b/docs/content/recipes/_category_.yml index 59f1a24..ca26fbe 100644 --- a/docs/content/recipes/_category_.yml +++ b/docs/content/recipes/_category_.yml @@ -1,4 +1,4 @@ label: 'Recipes' -position: 7 +position: 8 collapsible: true collapsed: true