MarcDonald / twitch-spotify-request-bot

This is a bot that listens to the chat of a given Twitch stream for messages with a Spotify song link in them and then adds that song to a playlist and/or your queue.
https://www.marcdonald.com
MIT License
31 stars 22 forks source link

Bot response in twitch-chat #7

Closed Colorful98 closed 3 years ago

Colorful98 commented 3 years ago

Would it be possible to make the bot respond in the chat using a defined twitch account?

For example my twitch is: abcd And a second twitch account for the bot would be: abcd_bot (ofc the streamer would need to set this up on their own)

I understand that this adds another layer of complexity to the bot as it has to be authorized to twitch aswell as spotify! But it would be amazing to get some form of response for the viewers attempting to "request" songs to be played on stream 👍

Basically, when the bot detects the command (i use !spotify as prefix) it responds in chat with something like this:

Success: "Song XYZ was added to the playlist"
Fail (already in playlist): "Song XYZ is already in the playlist"
Fail (no link): "No spotify link detected"

I'm facing the issue that the people using the command are confused regarding if the song was actually added to the playlist or not, since the playlist isn't available to everyone 👍

Kind Regards, Colorful

MarcDonald commented 3 years ago

This should be possible, I'll have a look into it

MarcDonald commented 3 years ago

Hey, I've added this feature in Version 3.0.0. You'll need to generate a Twitch OAuth Token for it to be used, but it's all explained in the readme. Let me know if you have any issues with it.

Colorful98 commented 3 years ago

Hey again, nice one! 👍

However, i keep getting the following error when building:

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'build'
1 verbose cli ]
2 info using npm@6.14.12
3 info using node@v14.16.1
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle twitch-spotify-request@3.0.0~prebuild: twitch-spotify-request@3.0.0
6 info lifecycle twitch-spotify-request@3.0.0~build: twitch-spotify-request@3.0.0
7 verbose lifecycle twitch-spotify-request@3.0.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle twitch-spotify-request@3.0.0~build: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\mlund\Desktop\roxybot\twitch-spotify-request-bot\node_modules\.bin;C:\Users\mlund\AppData\Local\Temp\yarn--1618446233514-0.5342763062642413;C:\Users\mlund\Desktop\roxybot\twitch-spotify-request-bot\node_modules\.bin;C:\Users\mlund\AppData\Local\Yarn\Data\link\node_modules\.bin;C:\Users\mlund\AppData\Local\Yarn\bin;C:\Program Files\libexec\lib\node_modules\npm\bin\node-gyp-bin;C:\Program Files\lib\node_modules\npm\bin\node-gyp-bin;C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;C:\Users\mlund\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\mlund\bin;C:\Python39\Scripts;C:\Python39;C:\Program Files (x86)\Razer\ChromaBroadcast\bin;C:\Program Files\Razer\ChromaBroadcast\bin;C:\Program Files (x86)\Razer Chroma SDK\bin;C:\Program Files\Razer Chroma SDK\bin;C:\program files (x86)\razer chroma sdk\bin;C:\program files\razer chroma sdk\bin;C:\program files (x86)\razer\chromabroadcast\bin;C:\program files\razer\chromabroadcast\bin;C:\program files (x86)\common files\oracle\java\javapath;C:\windows\system32;C:\windows;C:\windows\system32\wbem;C:\windows\system32\windowspowershell\v1.0;C:\windows\system32\openssh;C:\program files\nvidia corporation\nvidia nvdlisr;C:\users\mlund\appdata\local\microsoft\windowsapps;C:\program files\mkvtoolnix;C:\adb;C:\program files\crucial\crucial storage executive;C:\program files (x86)\fahclient;C:\users\mlund\appdata\local\hyper\app-2.1.2\resources\bin;C:\program files\filebot;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Users\mlund\AppData\Local\Microsoft\WindowsApps;C:\Program Files\MKVToolNix;C:\Program Files (x86)\FAHClient;C:\Users\mlund\AppData\Local\hyper\app-2.1.2\resources\bin;C:\Users\mlund\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64;C:\Users\mlund\AppData\Local\atom\bin;C:\Program Files\WireGuard;C:\Program Files\dotnet;C:\Program Files\PuTTY;C:\TDM-GCC-64\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\Git\cmd;C:\Program Files\nodejs;C:\ProgramData\chocolatey\bin;C:\Users\mlund\AppData\Local\Microsoft\WindowsApps;C:\Program Files\MKVToolNix;C:\Users\mlund\AppData\Local\hyper\app-2.1.2\resources\bin;C:\Users\mlund\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64;C:\Program Files (x86)\OpenVPN\bin;C:\Users\mlund\AppData\Local\Microsoft\WindowsApps;C:\Users\mlund\AppData\Roaming\npm;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl
9 verbose lifecycle twitch-spotify-request@3.0.0~build: CWD: C:\Users\mlund\Desktop\roxybot\twitch-spotify-request-bot
10 silly lifecycle twitch-spotify-request@3.0.0~build: Args: [ '/d /s /c', 'tsc' ]
11 silly lifecycle twitch-spotify-request@3.0.0~build: Returned: code: 2  signal: null
12 info lifecycle twitch-spotify-request@3.0.0~build: Failed to exec build script
13 verbose stack Error: twitch-spotify-request@3.0.0 build: `tsc`
13 verbose stack Exit status 2
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:315:20)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:315:20)
13 verbose stack     at maybeClose (internal/child_process.js:1048:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid twitch-spotify-request@3.0.0
15 verbose cwd C:\Users\mlund\Desktop\roxybot\twitch-spotify-request-bot
16 verbose Windows_NT 10.0.19042
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
18 verbose node v14.16.1
19 verbose npm  v6.14.12
20 error code ELIFECYCLE
21 error errno 2
22 error twitch-spotify-request@3.0.0 build: `tsc`
22 error Exit status 2
23 error Failed at the twitch-spotify-request@3.0.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]

I solved the problem however, in config.json.template there is a formatting issue on line 7! "BOT_USERNAME: "", should be "BOT_USERNAME": "",

Kind Regards Colorful

MarcDonald commented 3 years ago

Whoops 🤦‍♂️ Thanks for letting me know, there's another PR open that changes the way the config is loaded so this'll be fixed in the next version

Colorful98 commented 3 years ago

No problems! 🥇

I'm just happy i can help the development of this AMAZING piece of software! 😄

Thank you, i have a couple questions so perhaps if you could add me on discord: Colorful#0001 we could chat about it 😄

MarcDonald commented 3 years ago

Thanks for the kind words 😄

I'll add you on Discord now to discuss your questions