7tv 中文文档教程

发布于 3年前 浏览 33 项目主页 更新于 3年前

7TV API

Sammwy 用爱制作的用于 Node.js 的非官方 7TV API 包装器

⚙️ Installation

# With YARN:
yarn add 7tv

# With NPM:
npm install 7tv

Usage

Get user data

const SevenTV = require("../lib");
const api = SevenTV();

async function test () {
    const user = await api.fetchUser("username_here");
    console.log(user); // Returns User (Class)
}

Get user emotes

const SevenTV = require("../lib");
const api = SevenTV();

async function test () {
    const emotes = await api.fetchUserEmotes("username_here");
    console.log(emotes); // Returns array of Emote (Class)
}

Classes

Emote class

{
    "id": String,
    "name": String,
    "owner_id": String,
    "visibility": Number,
    "tags": [String],
    "height": [Number],
    "width": [Number]
}

User class

{
    "id": String,
    "description": String,
    "editor_ids": [String],
    "display_name": String,
    "twitch_id": String,
    "profile_image_url": String,
    "banned": Boolean,
    "role": {
        "name": String,
        "color": String,
        "position": Number
    }
}

❤️

,捐赠于 PayPal

???? 7TV API

Unofficial 7TV API Wrapper for Node.js

⚙️ Installation

# With YARN:
yarn add 7tv

# With NPM:
npm install 7tv

???? Usage

Get user data

const SevenTV = require("../lib");
const api = SevenTV();

async function test () {
    const user = await api.fetchUser("username_here");
    console.log(user); // Returns User (Class)
}

Get user emotes

const SevenTV = require("../lib");
const api = SevenTV();

async function test () {
    const emotes = await api.fetchUserEmotes("username_here");
    console.log(emotes); // Returns array of Emote (Class)
}

???? Classes

Emote class

{
    "id": String,
    "name": String,
    "owner_id": String,
    "visibility": Number,
    "tags": [String],
    "height": [Number],
    "width": [Number]
}

User class

{
    "id": String,
    "description": String,
    "editor_ids": [String],
    "display_name": String,
    "twitch_id": String,
    "profile_image_url": String,
    "banned": Boolean,
    "role": {
        "name": String,
        "color": String,
        "position": Number
    }
}

❤️

Made with Love by Sammwy, Donate at PayPal

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文