⚠️ USE TRIANGLE.JS (@haelp/teto) INSTEAD
A Node.js library for tetr.io and ch.tetr.io, asynchronous and typed (well, mostly)
Warning
this library is still in heavy development. although useable, very fragile.
tetr.io is still in alpha, any new updates to the game have a chance to break the library if it goes unnoticed.
use an authorized bot account if you're trying to connect to the gateway or interact with the main game api!
Clientthe main guyapiwrapper around the rest apichanneltetra channelgamemain game
CONSTANTSbunch of enum-dictionary-like helper objectTypesbonus, typings for stuff like ribbon messaging, room config schema, etc
// test.ts - connect to gateway
import { Client, CONSTANTS } from "crimson.js"
const session = new Client("<token>")
session.events.on(CONSTANTS.EVENTS_TYPES.SESSION_READY, (endpoint) =>
{
console.log("ready!")
console.log(`connected to ${endpoint} as ${client.user.username}`)
})
session.login()λ npm install --production=falselocally install the dependencies, ts, tsup, and other dev dependenciesλ tscand emits the transpiled codes to./out/λ npx run bundleand emits the bundled cjs, esm, and dts codes to./dist/λ npx run docsto build the auto-generated docs and emits it to./docs/λ npx install -Sin a testing directory with"crimson.js": "file:<lib dir rel path>"inpackage.jsondependencies field
- my personal discord guild
- or the newly established dev-oriented tetr.io community guild (recommended)
- unofficial tetr.io bot docs (slightly outdated but still relevant)
- tetra channel api docs
- npm
Pull requests, open issues, or just a direct messages for any new ideas (especially with structuring the api and naming things) is all appreciated!
- osk, obviously, for creating tetr.io
- Zudo, for open sourcing the original Autohost source code
- craftxbox, for continuing Autohost development
Distributed under the Artistic License 2.0 with <3