koreanbots
TypeScript icon, indicating that this package has built-in type declarations

3.2.1 • Public • Published

Koreanbots.js

Version Documentation Maintenance License: MIT Downloads eslint.yml codecov-badge

TypeScript/JavaScript SDK for KOREANBOTS

🏠 홈페이지

설치

# NPM
$ npm install koreanbots
# Yarn
$ yarn add koreanbots

사용 조건

3.1 버전 이상은 Node.js v16.6.0 이상이 필요합니다. 그 이하 버전은 Node.js v12부터 지원됩니다.

discord.js version supported planned to support
v11.x no no
v12.x yes -
v13.x (stable) yes -

사용법

  • 자동 업데이트
const { KoreanbotsClient } = require("koreanbots")
const client = new KoreanbotsClient({
    intents: ["GUILDS", "GUILD_MESSAGES", "GUILD_MEMBERS"],
    koreanbots: {
        api: {
            token: "KOREANBOTS 토큰"
        }
    },
    koreanbotsClient: {
        updateInterval: 600000 //10분마다 서버 수를 업데이트합니다. (기본값 30분)
    }
})

client.on("ready", () => console.log(`${client.user.tag}로 로그인하였습니다.`))

client.login("토큰")

process.on("SIGINT", () => {
    client.destroy()
    process.exit()
})
  • 수동 업데이트
const { Koreanbots } = require("koreanbots")
const Discord = require("discord.js")
const client = new Discord.Client()
const koreanbots = new Koreanbots({
    api: {
        token: "KOREANBOTS 토큰"
    },
    clientID: "봇 아이디"
})

let update = servers => koreanbots.mybot.update({ servers, shards: client.shard?.count }) 
    .then(res => console.log("서버 수를 정상적으로 업데이트하였습니다!\n반환된 정보:" + JSON.stringify(res)))
    .catch(console.error)

client.on("ready", () => {
    console.log(`${client.user.tag}로 로그인하였습니다.`)

    update(client.guilds.cache.size) // 준비 상태를 시작할 때, 최초로 업데이트합니다.
    setInterval(() => update(client.guilds.cache.size), 600000) // 10분마다 서버 수를 업데이트합니다.
})

client.login("토큰")

Author

👤 zero734kr

🤝 도움주기

이슈와 PR은 모두 환영입니다!
무언가 문제가 생겼다면 이슈 페이지에 이슈를 열어주세요.
코드 수정 요청은 PR 페이지에 올려주세요.

서포트

만약 이 모듈이 도움이 되었다면 ⭐️를 눌러주세요!

📝 라이센스

Copyright © 2020-2021 koreanbots.
This project is MIT licensed.


This README was generated with ❤️ by readme-md-generator

Readme

Keywords

none

Package Sidebar

Install

npm i koreanbots

Weekly Downloads

49

Version

3.2.1

License

MIT

Unpacked Size

209 kB

Total Files

103

Last publish

Collaborators

  • wonderlandpark
  • zero734kr