@migan/koreanbots

@migan/koreanbots

이 패키지는 한국 디스코드 리스트의 공식 SDK가 아님을 알립니다.

설치

npm i @migan/koreanbots

사용

서버수 자동 업데이트

const { KoreanbotsClient } = require('@migan/koreanbots')
const { GatewayIntentBits } = require('discord.js')

const client = new KoreanbotsClient(
{
intents: [GatewayIntentBits.Guilds],
},
{
api: {
token: '당신의 봇의 한디리 토큰',
},
updateInterval: 600000,
}
)

client.login('당신의 봇의 토큰')

서버수 수동 업데이트

const { GatewayIntentBits, Client } = require('discord.js')
const { Koreanbots } = require('@migan/koreanbots')

const client = new Client({
intents: [GatewayIntentBits.Guilds],
})

const krBots = new Koreanbots({
api: {
token: '당신의 봇의 한디리 토큰',
},
clientId: '당신의 봇의 아이디',
})

client.on('ready', () => {
const update = () =>
krbots.myBot
.update({
servers: client.guilds.cache.size,
shards: client.shard?.count,
})
.then(res => console.log(JSON.stringify(res)))
update()
setInterval(update, 600000)
})

client.login('당신의 봇의 토큰')

(베타) 웹훅

웹훅 기능은 아직 정식 출시가 안되었습니다.

const { KoreanbotsWebhook } = require('@migan/koreanbots')

new KoreanbotsWebhook(port, body => {
console.log(JSON.stringify(body))
}).init()

Generated using TypeDoc