LinaTsukusu / youtube-chat

Fetch YouTube Live chats
MIT License
209 stars 44 forks source link

Support for sending messages? #68

Open Khyretos opened 2 years ago

Khyretos commented 2 years ago

will the package be able to send messages in the future?

neverclear86 commented 2 years ago

I'm not thinking about it right away, but I'd like to implement it someday.

Khyretos commented 2 years ago

The only thing you need to send messages is the 'liveChatId' as I read from YouTube API and you can send messages.

Thank you for this great bot

fu-raz commented 2 years ago

To send messages you need to login using the oAuth. It's a lot of work (for the user). You need to create an app in the Google Cloud console, download secret settings. Login using oAuth, get token, refresh the token when needed. I don't think you can do it without the YT API.

FlashlightXi commented 1 year ago

For my chatbot, I let my bot act like sending messages with browser, such as headers, payload, and some kind of frontend API keys through https://www.youtube.com/youtubei/v1/live_chat/send_message. I hope it helps

自分のチャットボットでは、ボットがブラウザを使用しているような振る舞い(リクエストヘッダーやペイロード、フロントエンドのAPIキーの使用)をしてメッセージを送信しています!


Edit: I also want a feature to timeout/hide user if the client is accessed from moderators/owner. It would make the repo to have more ability though, I'm looking for it.

これを読み返して思ったのですがタイムアウトや非表示の機能も追加できるとよりAPIの代替としてyoutube-chatが使えてくると思います🤔

FlashlightXi commented 4 months ago

The way I provided above seemed to be broken, (New headers are probably expired in a few minutes so that making the bot impossible to send) so I'd like to suggest support for sending messages without usage of YouTube API.

最近この方法が使えなくなってしまった(新たにヘッダー等を用意しても数分で送信しなくなる ⇒ 認証が数分で期限切れになることによる?)ので、再度 YouTube API を用いない方法でのメッセージ送信を提起したいと思います。