mangosango / clive Goto Github PK
View Code? Open in Web Editor NEWA webhook server that posts clips in Twitch chat to Discord
License: GNU General Public License v3.0
A webhook server that posts clips in Twitch chat to Discord
License: GNU General Public License v3.0
`[1609026142083] INFO (TwitchJS/Chat/14212 on raspberrypi): PRIVMSG/#brettdoesgaming rainee4357: https://clips.twitch.tv/MagnificentCleverCaribouKappaWealth
[1609026142110] ERROR (TwitchJS/Chat/Client/14212 on raspberrypi): Parsing error encountered. Please create an issue: https://github.com/twitch-js/twitch-js/issues/new?title=Parsing%20error%20encountered&body=%40badge-info%3D%3Bbadges%3Dmoderator%2F1%2Cglitchcon2020%2F1%3Bclient-nonce%3Df8bef847ffb4ce7fa442616102795c8c%3Bcolor%3D%23952197%3Bdisplay-name%3Drainee4357%3Bemotes%3D%3Bflags%3D%3Bid%3D9e82720a-f4a9-4548-9690-2093135ae218%3Bmod%3D1%3Broom-id%3D49651280%3Bsubscriber%3D0%3Btmi-sent-ts%3D1609026141961%3Bturbo%3D0%3Buser-id%3D49262317%3Buser-type%3Dmod%20%3Arainee4357%21rainee4357%40rainee4357.tmi.twitch.tv%20PRIVMSG%20%23brettdoesgaming%20%3Ahttps%3A%2F%2Fclips.twitch.tv%2FMagnificentCleverCaribouKappaWealth%0D%0A {}
[1609026142114] INFO (TwitchJS/Chat/14212 on raspberrypi): PARSE_ERROR_ENCOUNTERED : [TwitchJS] Parse error encountered [Chat]
/home/pi/Clive/node_modules/twitch-js/lib/Chat/Client.js:210
throw errorMessage;
^
Error: [TwitchJS] Parse error encountered [Chat]
at ParseError.ChatError [as constructor] (/home/pi/Clive/node_modules/twitch-js/lib/Chat/Errors.js:26:24)
at new ParseError (/home/pi/Clive/node_modules/twitch-js/lib/Chat/Errors.js:50:28)
at Client._handleMessage (/home/pi/Clive/node_modules/twitch-js/lib/Chat/Client.js:207:32)
at WebSocket.onMessage (/home/pi/Clive/node_modules/twitch-js/node_modules/ws/lib/event-target.js:120:16)
at WebSocket.emit (events.js:198:13)
at Receiver.receiverOnMessage (/home/pi/Clive/node_modules/twitch-js/node_modules/ws/lib/websocket.js:800:20)
at Receiver.emit (events.js:198:13)
at Receiver.dataMessage (/home/pi/Clive/node_modules/twitch-js/node_modules/ws/lib/receiver.js:436:14)
at Receiver.getData (/home/pi/Clive/node_modules/twitch-js/node_modules/ws/lib/receiver.js:366:17)
at Receiver.startLoop (/home/pi/Clive/node_modules/twitch-js/node_modules/ws/lib/receiver.js:142:22)
at Receiver._write (/home/pi/Clive/node_modules/twitch-js/node_modules/ws/lib/receiver.js:77:10)
at doWrite (_stream_writable.js:415:12)
at writeOrBuffer (_stream_writable.js:399:5)
at Receiver.Writable.write (_stream_writable.js:299:11)
at TLSSocket.socketOnData (/home/pi/Clive/node_modules/twitch-js/node_modules/ws/lib/websocket.js:875:35)
at TLSSocket.emit (events.js:198:13)
at addChunk (_stream_readable.js:288:12)
at readableAddChunk (_stream_readable.js:269:11)
at TLSSocket.Readable.push (_stream_readable.js:224:10)
at TLSWrap.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
[nodemon] app crashed - waiting for file changes before starting...`
Seem to be getting some sort of error when I try and post a clip into chat not sure if its an issue with clive or twitch.js... I'm assuming it might be twitch.js here but I thought I post it here just in case
As the title says this error happens after a clip
https://clips.twitch.tv/PrettiestCrispyAlmondYouDontSay <<<
thats the clip i am attempting to use clive with
debug: NEW MESSAGE:
{"channel":"#brettdoesgaming","userstate":{"badges":{"bits-leader":"1"},"color":"#0000FF","display-name":"Excel101","emotes":null,"id":"bca8b4ea-4635-43b6-8807-b1d13602f561","mod":false,"room-id":"49651280","subscriber":false,"tmi-sent-ts":"1524114571878","turbo":false,"user-id":"49362490","user-type":null,"emotes-raw":null,"badges-raw":"bits-leader/1","username":"excel101","message-type":"chat"},"timestamp":"2018-04-19T05:09:31.916Z"}
[05:09] info: [#brettdoesgaming] : https://clips.twitch.tv/PrettiestCrispyAlmondYouDontSay
debug: NEW MESSAGE:
{"channel":"#brettdoesgaming","userstate":{"badges":{"moderator":"1","subscriber":"0","bits-leader":"3"},"color":"#952197","display-name":"MrMarioBrosFTW","emotes":null,"id":"cc947d92-d1e9-4fc9-b6dd-f36d2c1557d0","mod":true,"room-id":"49651280","subscriber":true,"tmi-sent-ts":"1524114584407","turbo":false,"user-id":"49262317","user-type":"mod","emotes-raw":null,"badges-raw":"moderator/1,subscriber/0,bits-leader/3","username":"mrmariobrosftw","message-type":"chat"},"timestamp":"2018-04-19T05:09:44.449Z"}
debug: CLIP DETECTED: in message: https://clips.twitch.tv/PrettiestCrispyAlmondYouDontSay {"timestamp":"2018-04-19T05:09:44.451Z"}
debug: URLs FOUND: 1 urls: {"0":"https://clips.twitch.tv/PrettiestCrispyAlmondYouDontSay","timestamp":"2018-04-19T05:09:44.453Z"}
debug: CLIP SLUG: PrettiestCrispyAlmondYouDontSay {"timestamp":"2018-04-19T05:09:44.463Z"}
info: GET: /clips?id=PrettiestCrispyAlmondYouDontSay {"timestamp":"2018-04-19T05:09:44.468Z"}
debug: Twitch clip results: {"id":"PrettiestCrispyAlmondYouDontSay","url":"https://clips.twitch.tv/PrettiestCrispyAlmondYouDontSay","embed_url":"https://clips.twitch.tv/embed?clip=PrettiestCrispyAlmondYouDontSay","broadcaster_id":"49651280","creator_id":"110349947","video_id":"251994271","game_id":"","language":"en","title":"Nate, the expert pilot.","view_count":2,"created_at":"2018-04-19T04:44:35Z","thumbnail_url":"https://clips-media-assets.twitch.tv/227303671-preview-480x272.jpg","timestamp":"2018-04-19T05:09:44.563Z"}
info: GET: /users?id=110349947 {"timestamp":"2018-04-19T05:09:44.565Z"}
info: GET: /users?id=49651280 {"timestamp":"2018-04-19T05:09:44.567Z"}
info: GET: /games?id= {"timestamp":"2018-04-19T05:09:44.568Z"}
debug: DEBUG: Async results:
{"0":{"id":"110349947","login":"narobicyt","display_name":"NarobicYT","type":"","broadcaster_type":"","description":"YouTube.com/NarobicYT","profile_image_url":"https://static-cdn.jtvnw.net/jtv_user_pictures/narobicyt-profile_image-9bdc19e483e21135-300x300.png","offline_image_url":"https://static-cdn.jtvnw.net/jtv_user_pictures/narobicyt-channel_offline_image-629de6fec7fc45c1-1920x1080.png","view_count":62},"1":{"id":"49651280","login":"brettdoesgaming","display_name":"BrettDoesGaming","type":"","broadcaster_type":"affiliate","description":"I'm a crazy College Kid who plays games cause that is what he likes to do!","profile_image_url":"https://static-cdn.jtvnw.net/jtv_user_pictures/080daf80b8e6202a-profile_image-300x300.png","offline_image_url":"https://static-cdn.jtvnw.net/jtv_user_pictures/b7be9f67936024e5-channel_offline_image-1920x1080.png","view_count":31022},"timestamp":"2018-04-19T05:09:44.669Z"}
(node:723) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'box_art_url' of undefined
at buildMessage (/home/noire/clive/index.js:363:27)
at Promise.all.then.results (/home/noire/clive/index.js:186:23)
at
(node:723) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:723) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
get this error whenever a new clip is created and clive attempts to post to discord
level: 'error',
message: "ERROR: GET twitch API:Cannot read property 'title' of undefined",
stack: "TypeError: Cannot read property 'title' of undefined\n" +
' at C:\Clive\src\index.js:152:22',
timestamp: '2021-09-17T18:20:03.836Z'
I'm getting an error when I try to start the script.
System is a CentOS 7 VPS
Terminal output below
> [email protected] start /home/botuser/Clive
> nodemon src/index.js
/home/botuser/Clive/node_modules/chokidar/index.js:161
async remove(item) {
^^^^^^
SyntaxError: Unexpected identifier
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/home/botuser/Clive/node_modules/nodemon/lib/monitor/watch.js:6:16)
npm ERR! Linux 3.10.0-1127.10.1.el7.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "start"
npm ERR! node v6.17.1
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `nodemon src/index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'nodemon src/index.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the clappybot package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! nodemon src/index.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs clappybot
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls clappybot
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/botuser/Clive/npm-debug.log
Is it doable to implement a way for clive to only post clips to discord when X selected channels playing Y games? Like we can filter only to grab clips from mods/subs. I was reading the code and thought of editing certain places but it worked better in my head. If not doable, I can work with the keywords, like "Only post clip if it contains "master" in the message and was posted by a mod" sorry if I failed to be clear.
Thank you in advance for your time.
I have been using a clip command for a stream I moderate for, the command doesn't always set a title on the clip and when that happens this errors out and doesn't post the clip in discord.
{
level: 'error',
message: "ERROR: GET twitch API:Cannot read property 'title' of undefined",
stack: "TypeError: Cannot read property 'title' of undefined\n" +
' at /home/pi/clive/src/index.js:152:22',
timestamp: '2022-10-16T03:07:47.800Z'
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.