YouTube Command for Botyo
The YouTube Command for Botyo posts a YouTube video to the chat.
Usage
#yt <search query>
or
#youtube <search query>
For example:
#yt Starboy
#yt ozzy man cat vs mantis
Requirements
You need to obtain an API key to use the YouTube Data API. Please refer to the YouTube API Reference for instructions how to do so.
Install
Step 1. Install the module from npm.
npm install --save botyo-command-youtube
Step 2. Configure the API key in your configuration file config.yaml
modules:
YouTubeCommand:
apiKey: YOUR_YOUTUBE_API_KEY
Step 3. Register the module.
import Botyo from "botyo";
import YouTubeCommand from "botyo-command-youtube"
Botyo.builder()
...
.registerModule(YouTubeCommand)
...
.build()
.start();
Configuration
The configuration of the YouTube command modules has some sensible defaults. However, you can still override the
defaults if you need to.
modules:
YouTubeCommand:
apiKey: YOUR_YOUTUBE_API_KEY
regionCode: US
order: relevance
safeSearch: moderate
You can override all configuration properties (except apiKey
) on a per-chat-thread basis. For example:
modules:
YouTubeCommand:
apiKey: YOUR_YOUTUBE_API_KEY
regionCode: US
order: relevance
safeSearch: moderate
chat-threads:
SOME_CHAT_THREAD_ID:
overrides:
modules.YouTubeCommand:
regionCode: BG
order: viewCount
OTHER_CHAT_THREAD_ID:
overrides:
modules.YouTubeCommand:
enable: false