2020-10-22 15:50:47 +00:00
|
|
|
import { Client } from '../models/client.ts'
|
|
|
|
import { GatewayIntents } from '../types/gatewayTypes.ts'
|
2020-10-22 15:55:42 +00:00
|
|
|
import { TOKEN } from './config.ts'
|
2020-10-25 06:50:32 +00:00
|
|
|
import * as cache from '../models/cache.ts'
|
2020-10-25 08:02:24 +00:00
|
|
|
import { Member } from '../structures/member.ts'
|
2020-10-25 17:03:53 +00:00
|
|
|
import { Channel } from '../structures/channel.ts'
|
|
|
|
import { GuildTextChannel } from '../structures/guildTextChannel.ts'
|
2020-10-22 15:50:47 +00:00
|
|
|
|
|
|
|
const bot = new Client()
|
|
|
|
|
2020-10-25 17:03:53 +00:00
|
|
|
bot.on('ready', () => {
|
|
|
|
console.log('READY!')
|
|
|
|
})
|
2020-10-23 16:11:00 +00:00
|
|
|
|
2020-10-25 17:03:53 +00:00
|
|
|
bot.on('channelUpdate', (before: Channel, after: Channel) => {
|
|
|
|
if (before instanceof GuildTextChannel && after instanceof GuildTextChannel) {
|
|
|
|
console.log(before.name)
|
|
|
|
console.log(after.name)
|
2020-10-29 14:43:27 +00:00
|
|
|
} else {
|
|
|
|
console.log(before)
|
|
|
|
console.log(after)
|
2020-10-25 17:03:53 +00:00
|
|
|
}
|
2020-10-25 06:50:32 +00:00
|
|
|
})
|
|
|
|
|
2020-10-25 17:03:53 +00:00
|
|
|
bot.connect(TOKEN, [
|
|
|
|
GatewayIntents.GUILD_MEMBERS,
|
|
|
|
GatewayIntents.GUILD_PRESENCES,
|
|
|
|
GatewayIntents.GUILD_MESSAGES
|
|
|
|
])
|