harmony/test/template.ts

22 lines
528 B
TypeScript
Raw Normal View History

2021-01-24 18:49:08 +00:00
import { Client, Intents } from '../../mod.ts'
import { TOKEN } from './config.ts'
const client = new Client()
client.on('guildLoaded', async (guild) => {
if (guild.id === 'GUILD_ID') {
console.log((await guild.syncTemplate('TEMPLATE_ID')).code)
console.log(
(
await guild.editTemplate('TEMPLATE_ID', {
name: 'asdf',
description: 'asdfasdfasdf'
})
).code
)
console.log((await guild.deleteTemplate('TEMPLATE_ID')).id)
}
})
client.connect(TOKEN, Intents.All)