mirror of
https://github.com/DiscordFactory/website-documentation.git
synced 2026-01-20 20:21:35 +01:00
🚧 Highlight demo component
This commit is contained in:
45
src/utils/CodeHighlignt.ts
Normal file
45
src/utils/CodeHighlignt.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
export const event = `
|
||||
import { Event, BaseEvent } from '@discord-factory/core'
|
||||
import { GuildMember } from 'discord.js'
|
||||
|
||||
@Event('guildMemberAdd')
|
||||
export default class FooEvent implements BaseEvent {
|
||||
public async run(member: GuildMember): Promise<void> {
|
||||
// Your code here
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export const command = `
|
||||
import { BaseCommand, Command } from '@discord-factory/core'
|
||||
import { Message } from 'discord.js'
|
||||
|
||||
@Command({
|
||||
label: 'MyCommand',
|
||||
description: 'MyCommand description',
|
||||
tag: 'mycommand'
|
||||
})
|
||||
export default class FooCommand implements BaseCommand {
|
||||
public async run(message: Message, args: string[]): Promise<void> {
|
||||
// Your code here
|
||||
}
|
||||
}`
|
||||
|
||||
export const slashCommand = `
|
||||
import { BaseSlashCommand, SlashCommand } from '@discord-factory/core'
|
||||
import { Message, CommandInteraction } from 'discord.js'
|
||||
|
||||
@SlashCommand({
|
||||
scope: ['guild id'], // or 'GLOBAL'
|
||||
roles: ['role id'],
|
||||
options: {
|
||||
name: 'send-ticket',
|
||||
description: 'SendEmbed ticket description',
|
||||
options: [],
|
||||
},
|
||||
})
|
||||
export default class FooSlashCommand implements BaseSlashCommand {
|
||||
public async run(interaction: CommandInteraction): Promise<void> {
|
||||
// Your code here
|
||||
}
|
||||
}`
|
||||
Reference in New Issue
Block a user