harmony/src/test/slash-only.ts

27 lines
762 B
TypeScript
Raw Normal View History

2020-12-22 10:10:19 +00:00
import { SlashClient } from '../models/slashClient.ts'
import { SlashCommandPartial } from '../types/slash.ts'
import { TOKEN } from './config.ts'
2021-01-01 08:52:15 +00:00
import { SlashModule, slashModule } from '../../mod.ts'
2021-01-01 08:52:15 +00:00
class MyMod extends SlashModule {}
class MySlashClient extends SlashClient {
@slashModule()
mod = new MyMod()
}
export const slash = new MySlashClient({ token: TOKEN })
console.log(slash.modules)
2020-12-22 10:10:19 +00:00
// Cmd objects come here
const commands: SlashCommandPartial[] = []
2020-12-21 13:48:46 +00:00
2020-12-22 10:10:19 +00:00
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}`)
})