mirror of
https://github.com/DiscordFactory/website-documentation.git
synced 2026-01-14 17:34:22 +01:00
📝 Write documentation
This commit is contained in:
@@ -1,98 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<Documentation title="Hooks">
|
<Documentation>
|
||||||
<p>
|
<Markdown v-if="data" :source="data" />
|
||||||
The @discord-factory/core module is intended to simplify access to certain resources such as commands,events registered within the instance of your application.
|
<Spinner v-else />
|
||||||
</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>
|
</Documentation>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import Markdown from '../../../../components/Markdown.vue'
|
||||||
import Documentation from '../../../../components/Documentation.vue'
|
import Documentation from '../../../../components/Documentation.vue'
|
||||||
import CodeHighlight from '../../../../components/CodeHighlight.vue'
|
import Spinner from '../../../../components/Spinner.vue'
|
||||||
import Divider from '../../../../components/Divider.vue'
|
import useDocumentation from '../../../../services/Documentation'
|
||||||
import LinkExternal from '../../../../components/LinkExternal.vue'
|
import { markdownEndpoint } from '../../../../utils/Navigation'
|
||||||
import AlertInfo from '../../../../components/AlertInfo.vue'
|
import { onMounted, ref } from 'vue'
|
||||||
const useClient = `
|
|
||||||
import { Application } from '@discord-factory/core'
|
|
||||||
|
|
||||||
const client = Application.getClient()
|
const data = ref('')
|
||||||
console.log(client)`
|
onMounted(async () => {
|
||||||
|
data.value = await useDocumentation(markdownEndpoint.APPLICATION_HOOK)
|
||||||
const useCommands = `
|
})
|
||||||
import { Application } from '@discord-factory/core'
|
</script>
|
||||||
|
|
||||||
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>
|
|
||||||
Reference in New Issue
Block a user