teaus-rebuild

1.0.3 • Public • Published

Библиотека TeaUs-Rebuild Установить:

npm i teaus-rebuild

Начнём создавать ботов: Создайте файл bot.js и вставьте туда код:

const teaus = require("teaus-rebuild")

const bot = new teaus.Bot({
token: "TOKEN", 
prefix: "!" 
})

bot.onMessage()

Далее для создания первой команды вставляем в bot.js этот код:

bot.Command({
    name: "trigger",
    code: `code`
})

Работаем с когами: Для начала заменяем весь код (кроме команд) файла bot.js, на этот:

const teaus = require("teaus-rebuild")
 
const bot = new teaus.Bot({
token: "token", 
prefix: "!" 
})
 
bot.onMessage()
 
const fs = require('fs')

const folders = fs.readdirSync("./commands/")

for (const files of folders) {
const folder = fs.readdirSync(`./commands/${files}/`).filter(file => file.endsWith(".js"))

for (const commands of folder) {
const command = require(`./commands/${files}/${commands}`) 
bot.command({
name: command.name,
code: command.code
})
} 
}

Readme

Keywords

Package Sidebar

Install

npm i teaus-rebuild

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

109 kB

Total Files

45

Last publish

Collaborators

  • smalltea