koreanbots / js-sdk

Official JS SDK for Koreanbots

Home Page:https://js-sdk-docs.pages.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Official JS SDK for Koreanbots

https://js-sdk-docs.pages.dev

License:MIT License


Languages

Language:TypeScript 91.3%Language:JavaScript 8.7%