ekkx / yay.js

A powerful JavaScript API library for interacting with Yay! (yay.space)

Home Page:https://www.npmjs.com/package/yay.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


yay.js


Discord server license npm version npm downloads

利用者の皆様へ
> 2024 年 5 月 1 日をもちまして、「好きでつながるバーチャルワールド Yay!(イェイ)」のライブラリである yaylib 及び yay.js のソースコードは一時的に非公開となります。それに伴い、これらのライブラリのアップデートやメンテナンスも一時停止いたします。
利用者の皆様にはご迷惑をおかけしますがご理解のほどよろしくお願いいたします。

About

同世代と趣味の通話コミュニティ - Yay!(イェイ)の API を簡単に扱える Node.js モジュールです。

  • オブジェクト指向
  • 非同期処理に対応
  • クッキーに対応
  • API を 100% カバー

Python 版はこちら

Installation

Node.js 16.17.0 以上のバージョンが必要です。

npm install yay.js

Example usage

yay.js をインストール:

npm install yay.js

通常の API にアクセスする場合:

import { Client } from 'yay.js';

const main = async () => {
  const client = new Client();

  await client.login({
    email: 'yourEmail',
    password: 'yourPassword',
  });

  await client.createPost({
    text: 'Hello with yay.js!',
    sharedUrl: 'https://github.com/ekkx/yay.js',
  });
};

main();

WebSocket を使用する場合:

import { Client, GatewayIntents } from 'yay.js';
const client = new Client({ intents: [GatewayIntents.ChatMessage] });

client.on('ready', () => {
  console.log('The bot is ready!');
});

client.on('messageCreate', async (message) => {
  if (message.text === 'ping') {
    await client.sendMessage({
      text: 'pong',
      roomId: message.roomId,
    });
  }
});

client.login({
  email: 'yourEmail',
  password: 'yourPassword',
});

Links

Contributing

現在開発中です。
以下のアイコンをクリックして参加!

Help

もしドキュメントを読んでもわからないことがあったり、なかなか解決しない問題があった場合は、遠慮なく yay.js の公式 Discord サーバーに参加してください!

About

A powerful JavaScript API library for interacting with Yay! (yay.space)

https://www.npmjs.com/package/yay.js

License:MIT License