2020-10-22 15:50:47 +00:00
|
|
|
import { Client } from '../models/client.ts'
|
2020-10-23 16:11:00 +00:00
|
|
|
import { Guild } from '../structures/guild.ts'
|
2020-10-22 15:50:47 +00:00
|
|
|
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'
|
|
|
|
import { Member } from "../structures/member.ts"
|
|
|
|
import { User } from "../structures/user.ts"
|
|
|
|
import endpoint from "../types/endpoint.ts"
|
|
|
|
import { Base } from "../structures/base.ts"
|
|
|
|
import { GuildChannel } from "../structures/guildChannel.ts"
|
2020-10-22 15:50:47 +00:00
|
|
|
|
|
|
|
const bot = new Client()
|
|
|
|
|
2020-10-25 06:50:32 +00:00
|
|
|
bot.connect(TOKEN, [GatewayIntents.GUILD_MEMBERS, GatewayIntents.GUILD_PRESENCES, GatewayIntents.GUILD_MESSAGES])
|
2020-10-23 16:11:00 +00:00
|
|
|
|
|
|
|
|
2020-10-25 06:50:32 +00:00
|
|
|
const member = <Member> await Member.autoInit(bot, {
|
|
|
|
cacheName: 'member',
|
|
|
|
endpoint: 'GUILD_MEMBER',
|
|
|
|
restURLfuncArgs: ['668753256419426314', '333432936390983680']
|
|
|
|
})
|
|
|
|
console.log('getted (cached) ' + member.id)
|
|
|
|
setInterval(async () => {
|
|
|
|
//refreshed check
|
|
|
|
console.log('refreshed check: ' + member.id)
|
|
|
|
//cached
|
|
|
|
console.log('cache: '+(<Member> cache.get('member', '668753256419426314:333432936390983680')).id)
|
|
|
|
}, 10000)
|
|
|
|
|
|
|
|
setInterval(async() => {
|
|
|
|
member.refresh(bot, {
|
|
|
|
cacheName: 'member',
|
|
|
|
endpoint: 'GUILD_MEMBER',
|
|
|
|
restURLfuncArgs: ['668753256419426314', '333432936390983680']
|
2020-10-25 00:15:33 +00:00
|
|
|
})
|
2020-10-25 06:50:32 +00:00
|
|
|
//refreshed
|
|
|
|
console.log('refreshed: ' + member.id)
|
|
|
|
}, 20000)
|