change sendMessage wrapper, migrate from websocket connection to webhook for EventSub (reverse proxy)

This commit is contained in:
2025-06-24 01:36:43 +02:00
parent 37a38eb9e0
commit 2a430befbf
9 changed files with 75 additions and 30 deletions

View File

@@ -1,4 +1,7 @@
import { eventSub } from "..";
import { eventSub, streamerApi } from "..";
await streamerApi.eventSub.deleteAllSubscriptions();
console.info('Succesfully deleted all unused EventSub subscriptions');
eventSub.onRevoke(event => {
console.info(`Successfully revoked EventSub subscription: ${event.id}`);
@@ -9,9 +12,9 @@ eventSub.onSubscriptionCreateSuccess(event => {
});
eventSub.onSubscriptionCreateFailure(event => {
eventSub.stop()
console.error(`Failed to create EventSub subscription: ${event.id}`);
eventSub.start()
event.stop()
event.start()
});
eventSub.onSubscriptionDeleteSuccess(event => {
@@ -29,3 +32,5 @@ for (const file of files) {
if (file === import.meta.file) continue;
await import(import.meta.dir + '/' + file.slice(0, -3));
};
eventSub.start();