Get new videos from YouTube channels and playlists on Discord
$ npm i
$ cp config.json.dist config.jsonEdit the newly created file:
{
"discord": {
"token": "Discord bot token",
"channelId": "Discord channel id"
},
"youtube": {
"key": "YouTube API key",
"subs": [
{
"channelId": "YouTube channel id",
"q": "keywords to filter videos by their title"
},
{
"playlistId": "YouTube playlist id"
},
// ...
]
},
"openai": {
"key": "OpenAI API key", // cf. infra
"temperature": 0 // 0-1
},
"wikipedia": {
"language": "en" // cf. infra (default)
}
}You can use this online tool to find channel ids if needed. Playlist ids are directly accessible from client-facing URLs: https://www.youtube.com/playlist?list={playlistId}
$ npm startLatest videos from each channel (matching the q parameter, if there is one) will be stored locally in the latest.json file. Whenever this tool runs and a latest video changes, its link will be posted to the relevant Discord channel.
$ npm run resetRemoves the latest.json file to reset stored latest videos.
Using these requires having the bot running in the background (using e.g. pm2) and listening to messages in the channel, reacting to the ones @mentioning it:
$ npm run gpt # replies using ChatGPT
$ npm run wiki # checks Wikipedia to confirm whether a given person is dead yet