mirror of
https://github.com/DiscordFactory/website-documentation.git
synced 2026-01-14 17:34:22 +01:00
✨ Work in progress
This commit is contained in:
@@ -119,7 +119,7 @@
|
||||
v-else
|
||||
:key="item.name"
|
||||
:to="item.href"
|
||||
:class="[item.current ? 'bg-gray-100 text-gray-900' : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900', 'w-full group flex items-center px-2 py-2 text-base font-medium rounded-md']">
|
||||
:class="[item.current ? 'bg-gray-100 text-gray-900' : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900', 'w-1/2 ml-auto group flex items-center py-2 text-base font-medium rounded-md']">
|
||||
{{ item.label }}
|
||||
</router-link>
|
||||
</template>
|
||||
|
||||
@@ -9,12 +9,14 @@ import Event from './base/Event.vue'
|
||||
import Middleware from './base/Middleware.vue'
|
||||
import Hook from './base/Hook.vue'
|
||||
import Deployment from './advanced/Deployment.vue'
|
||||
import PartialHooks from './base/PartialHooks.vue'
|
||||
|
||||
const routes: RouteRecordRaw[] = [
|
||||
{ path: '/documentation/getting-started', component: GettingStarted },
|
||||
{ path: '/documentation/starting', component: Starting },
|
||||
{ path: '/documentation/environment', component: Environment },
|
||||
{ path: '/documentation/structure', component: Structure },
|
||||
{ path: '/documentation/partial-hooks', component: PartialHooks },
|
||||
{ path: '/documentation/commands', component: Command },
|
||||
{ path: '/documentation/slash-commands', component: SlashCommand },
|
||||
{ path: '/documentation/events', component: Event },
|
||||
|
||||
98
src/templates/modules/documentation/base/PartialHooks.vue
Normal file
98
src/templates/modules/documentation/base/PartialHooks.vue
Normal file
@@ -0,0 +1,98 @@
|
||||
<template>
|
||||
<Documentation title="Hooks">
|
||||
<p>
|
||||
The @discord-factory/core module is intended to simplify access to certain resources such as commands,events registered within the instance of your application.
|
||||
</p>
|
||||
|
||||
<div class="space-y-5">
|
||||
<h2>useClient</h2>
|
||||
<p>
|
||||
Returns the instance of the Discord Client linked to the bot.
|
||||
</p>
|
||||
<CodeHighlight class="w-min" :code="useClient" />
|
||||
</div>
|
||||
|
||||
<div class="space-y-5">
|
||||
<h2>useCommands</h2>
|
||||
<p>
|
||||
Returns the set of commands registered within the application instance.
|
||||
</p>
|
||||
<CodeHighlight class="w-min" :code="useCommands" />
|
||||
</div>
|
||||
|
||||
<div class="space-y-5">
|
||||
<h2>useEvents</h2>
|
||||
<p>
|
||||
Returns the set of events registered within the application instance.
|
||||
</p>
|
||||
<CodeHighlight class="w-min" :code="useEvents" />
|
||||
</div>
|
||||
|
||||
<div class="space-y-5">
|
||||
<h2>useMiddlewares</h2>
|
||||
<p>
|
||||
Returns the set of middlewares registered within the application instance.
|
||||
</p>
|
||||
<CodeHighlight class="w-min" :code="useMiddlewares" />
|
||||
</div>
|
||||
|
||||
<div class="space-y-5">
|
||||
<h2>useHooks</h2>
|
||||
<p>
|
||||
Returns the set of hooks registered within the application instance.
|
||||
</p>
|
||||
<CodeHighlight class="w-min" :code="useHooks" />
|
||||
</div>
|
||||
|
||||
<div class="space-y-5">
|
||||
<h2>useProviders</h2>
|
||||
<p>
|
||||
Returns the set of providers registered within the application instance.
|
||||
</p>
|
||||
<CodeHighlight class="w-min" :code="useProviders" />
|
||||
</div>
|
||||
</Documentation>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import Documentation from '../../../../components/Documentation.vue'
|
||||
import CodeHighlight from '../../../../components/CodeHighlight.vue'
|
||||
import Divider from '../../../../components/Divider.vue'
|
||||
import LinkExternal from '../../../../components/LinkExternal.vue'
|
||||
import AlertInfo from '../../../../components/AlertInfo.vue'
|
||||
const useClient = `
|
||||
import { Application } from '@discord-factory/core'
|
||||
|
||||
const client = Application.getClient()
|
||||
console.log(client)`
|
||||
|
||||
const useCommands = `
|
||||
import { Application } from '@discord-factory/core'
|
||||
|
||||
const commands = Application.getCommands()
|
||||
console.log(commands)`
|
||||
|
||||
const useEvents = `
|
||||
import { Application } from '@discord-factory/core'
|
||||
|
||||
const events = Application.getEvents()
|
||||
console.log(events)`
|
||||
|
||||
const useMiddlewares = `
|
||||
import { Application } from '@discord-factory/core'
|
||||
|
||||
const middlewares = Application.getMiddlewares()
|
||||
console.log(middlewares)`
|
||||
|
||||
const useHooks = `
|
||||
import { Application } from '@discord-factory/core'
|
||||
|
||||
const hooks = Application.getHooks()
|
||||
console.log(hooks)`
|
||||
|
||||
const useProviders = `
|
||||
import { Application } from '@discord-factory/core'
|
||||
|
||||
const providers = Application.getProviders()
|
||||
console.log(providers)`
|
||||
</script>
|
||||
@@ -14,14 +14,15 @@ export const socials = [
|
||||
]
|
||||
|
||||
export const documentation = [
|
||||
{ label: 'Getting starting', href: '/documentation/getting-started', isMenu: false },
|
||||
{
|
||||
label: 'Basic',
|
||||
isMenu: true,
|
||||
child: [
|
||||
{ label: 'Getting starting', href: '/documentation/getting-started', isMenu: false },
|
||||
{ label: 'Starting', href: '/documentation/starting', isMenu: false },
|
||||
{ label: 'Environment', href: '/documentation/environment', isMenu: false },
|
||||
{ label: 'Structure', href: '/documentation/structure', isMenu: false },
|
||||
{ label: 'Partial Hoohs', href: '/documentation/partial-hooks', isMenu: false },
|
||||
{ label: 'Commands', href: '/documentation/commands', isMenu: false },
|
||||
{ label: 'Slash Commands', href: '/documentation/slash-commands', isMenu: false },
|
||||
{ label: 'Events', href: '/documentation/events', isMenu: false },
|
||||
|
||||
Reference in New Issue
Block a user