add cmd meta

This commit is contained in:
DjDeveloperr 2021-04-08 15:10:50 +05:30
parent d681dc41a7
commit 97ce6d1f36
4 changed files with 39 additions and 4 deletions

29
test/meta.ts Normal file
View file

@ -0,0 +1,29 @@
import {
CommandClient,
Command,
Intents,
CommandOptions,
CommandContext
} from '../mod.ts'
import { TOKEN } from './config.ts'
const client = new CommandClient({
prefix: '!',
token: TOKEN,
intents: Intents.None
})
class Ping extends Command {
static meta: CommandOptions = {
name: 'ping',
aliases: 'pong'
}
execute(ctx: CommandContext): void {
ctx.message.reply('Pong!')
}
}
client.commands.add(Ping)
client.connect()

View file

@ -1,4 +1,4 @@
import { SlashClient } from '../../mod.ts'
import { SlashClient } from '../mod.ts'
import { SLASH_ID, SLASH_PUB_KEY, SLASH_TOKEN } from './config.ts'
import { listenAndServe } from 'https://deno.land/std@0.90.0/http/server.ts'