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("ํ ํฐ")
๐ค zero734kr
- ๊ฐ์ธ GitHub: @zero734kr
- Organization GitHub: @koreanbots
์ด์์ PR์ ๋ชจ๋ ํ์์
๋๋ค!
๋ฌด์ธ๊ฐ ๋ฌธ์ ๊ฐ ์๊ฒผ๋ค๋ฉด ์ด์ ํ์ด์ง์ ์ด์๋ฅผ ์ด์ด์ฃผ์ธ์.
์ฝ๋ ์์ ์์ฒญ์ PR ํ์ด์ง์ ์ฌ๋ ค์ฃผ์ธ์.
๋ง์ฝ ์ด ๋ชจ๋์ด ๋์์ด ๋์๋ค๋ฉด โญ๏ธ๋ฅผ ๋๋ฌ์ฃผ์ธ์!
Copyright ยฉ 2020-2021 koreanbots.
This project is MIT licensed.
This README was generated with โค๏ธ by readme-md-generator