1.0.0 • Published 1 year ago

tochi v1.0.0

Weekly downloads
-
License
Artistic-2.0
Repository
github
Last release
1 year ago

Tochi // トチ

Tetra Channel API Wrapper for Node.js, Modeled after the API itself, Promise-based and Typed.

!IMPORTANT
Not Affiliated with TETR.IO or osk.
Since TETR.IO is still in alpha, Any overlooked changes made to the game may break the library.
Honor the API limits and use responsibly.

Exports

  • generalStats()
  • generalActivity()
  • userInfo(user)
  • userRecords(user)
  • userSearch(snowflake)
  • leaderboardLeague(country*, limit*, after*, before*)
  • leaderboardLeagueAll(country*)
  • leaderboardXP(country*, limit*, after*, before*)
  • streams(type, context, id*)
  • news(stream, limit*)
  • newsAll(limit*)
  • get(endpoint) - generic fetch function
  • endpoints - contains the API endpoints, uses the same name as the main functions
  • Types - contains the Type definitions, uses the same name as the main functions

Example

import { userInfo } from "tochi"

const res = await userInfo("finbot")

if (res.success) // make sure the request is successful
{
    console.log(res.data.user._id)
    console.log(res.data.user.botmaster)
}
const { userSearch } = require("tochi")

userSearch("263872620661964800").then(res => 
{
    if (res.error) return
    console.log(res.data.user._id)
    console.log(res.data.user.username)
})

Links

Bugs report, feedback, and direct messages is appreciated.

Tochi doesn't mean anything really, just an anagram of "ch.t,,,.io", kana so it looks cool or something.

Distributed under the Artistic License 2.0, made with <3

1.0.0

1 year ago