-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added emitters and hooks, fixed postRequest()
- Added emitters and hooks to be able to have async calls so every process is some what multithreaded/parallized. - Fixed postRequest() and remvoed postRequestMore() as they are doing the same thing but with a small difference between them.
- Loading branch information
Showing
23 changed files
with
193 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
require('dotenv').config({path:'../../.env'}); | ||
|
||
module.exports = { | ||
getServerHook(emitter, twitchBot, discordBot) { | ||
emitter.on('server:logging', (message) => { | ||
discordBot.log(message); | ||
}) | ||
|
||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
require('dotenv').config({path:'../../.env'}); | ||
|
||
module.exports = { | ||
getTwitchHook(emitter, twitchBot, discordBot) { | ||
emitter.on('stream.online',(data) => { | ||
const event = data.event; | ||
emitter.emit('server:logging', `**ONLINE**: ${event.broadcaster_user_login}`); | ||
}) | ||
emitter.on('stream.offline',(data) => { | ||
const event = data.event | ||
emitter.emit('server:logging', `**OFFLINE**: ${event.broadcaster_user_login}`); | ||
}) | ||
emitter.on('channel.raid',(data) => { | ||
const event = data.event; | ||
emitter.emit('server:logging', `**RAIDING**: ${event.from_broadcaster_user_login} raided ${event.to_broadcaster_user_login} ${event.viewers} viewers`); | ||
}) | ||
emitter.on('channel.follow',(data) => { | ||
// "event": { | ||
// "user_id": "1234", | ||
// "user_login": "cool_user", | ||
// "user_name": "Cool_User", | ||
// "broadcaster_user_id": "1337", | ||
// "broadcaster_user_login": "cooler_user", | ||
// "broadcaster_user_name": "Cooler_User", | ||
// "followed_at": "2020-07-15T18:16:11.17106713Z" | ||
// } | ||
}) | ||
emitter.on('channel.subscribe',(data) => { | ||
// channel:read:subscriptions | ||
// "event": { | ||
// "user_id": "1234", | ||
// "user_login": "cool_user", | ||
// "user_name": "Cool_User", | ||
// "broadcaster_user_id": "1337", | ||
// "broadcaster_user_login": "cooler_user", | ||
// "broadcaster_user_name": "Cooler_User", | ||
// "tier": "1000", | ||
// "is_gift": false | ||
// } | ||
}); | ||
emitter.on("channel.subscription.gift", (data) => { | ||
// channel:read:subscriptions | ||
// "event": { | ||
// "user_id": "1234", | ||
// "user_login": "cool_user", | ||
// "user_name": "Cool_User", | ||
// "broadcaster_user_id": "1337", | ||
// "broadcaster_user_login": "cooler_user", | ||
// "broadcaster_user_name": "Cooler_User", | ||
// "total": 2, | ||
// "tier": "1000", | ||
// "cumulative_total": 284, //null if anonymous or not shared by the user | ||
// "is_anonymous": false | ||
// } | ||
}) | ||
emitter.on("channel.subscription.message", (data) => { | ||
// channel:read:subscriptions | ||
// "event": { | ||
// "user_id": "1234", | ||
// "user_login": "cool_user", | ||
// "user_name": "Cool_User", | ||
// "broadcaster_user_id": "1337", | ||
// "broadcaster_user_login": "cooler_user", | ||
// "broadcaster_user_name": "Cooler_User", | ||
// "tier": "1000", | ||
// "message": { | ||
// "text": "Love the stream! FevziGG", | ||
// "emotes": [ | ||
// { | ||
// "begin": 23, | ||
// "end": 30, | ||
// "id": "302976485" | ||
// } | ||
// ] | ||
// }, | ||
// "cumulative_months": 15, | ||
// "streak_months": 1, // null if not shared | ||
// "duration_months": 6 | ||
// } | ||
}) | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.