harmony/test/slash-only.ts
2021-04-04 11:22:47 +05:30

18 lines
578 B
TypeScript

import { SlashClient } from '../models/slashClient.ts'
import { SlashCommandPartial } from '../types/slash.ts'
import { TOKEN } from './config.ts'
export const slash = new SlashClient({ token: TOKEN })
console.log(slash.modules)
// Cmd objects come here
const commands: SlashCommandPartial[] = []
console.log('Creating...')
commands.forEach((cmd) => {
slash.commands
.create(cmd, '!! Your testing guild ID comes here !!')
.then((c) => console.log(`Created command ${c.name}!`))
.catch((e) => `Failed to create ${cmd.name} - ${e.message}`)
})