Discord-ts-app
  • README.md
  • GUIDE
    • Setup
    • Environment
    • Events
    • Commands
    • Middlewares
    • Modules
Powered by GitBook
On this page

Was this helpful?

  1. GUIDE

Modules

Currently, the application does not offer a way to automatically generate event files. For this, you just have to create a typecript file in the App/Modules/ folder and paste the code below :

import { Event, Events, Command, Middleware, Lifecycles } from '@discord-ts-app/function-decorator'
import { Message } from 'discord.js'

export default class Module {
	@Event('ready')
	public async event(message: Message): Promise<void> {
		// Your code here
	}

	@Command({ name: 'Command', description: 'Description of command', tag: 'command', alias: ['c'] })
	public async command(message: Message, args: Array<string>): Promise<void> {
		// Your code here
	}

	@Middleware('messageReceived')
	public async middleware(): Promise<void> {
		// Your code here
	}
}

PreviousMiddlewares

Last updated 4 years ago

Was this helpful?