Socket
Socket
Sign inDemoInstall

@twurple/eventsub-base

Package Overview
Dependencies
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@twurple/eventsub-base - npm Package Compare versions

Comparing version 7.1.0-pre.2 to 7.1.0-pre.3

es/events/chatNotifications/EventSubChannelChatAnnouncementNotificationEvent.mjs

24

lib/EventSubBase.d.ts
import { type Logger, type LoggerOptions } from '@d-fischer/logger';
import { EventEmitter } from '@d-fischer/typed-event-emitter';
import { type ApiClient, type HelixEventSubDropEntitlementGrantFilter, type HelixEventSubSubscription, type HelixEventSubTransportOptions, type UserIdResolvable } from '@twurple/api';
import { type EventSubChannelChatNotificationEvent } from './events/chatNotifications/EventSubChannelChatNotificationEvent';
import type { EventSubChannelAdBreakBeginEvent } from './events/EventSubChannelAdBreakBeginEvent';

@@ -464,21 +465,32 @@ import type { EventSubChannelBanEvent } from './events/EventSubChannelBanEvent';

*
* @param user The user for which to get notifications about chat being cleared in their channel.
* @param broadcaster The user for which to get notifications about chat being cleared in their channel.
* @param user The user to use for reading the channel's chat.
* @param handler The function that will be called for any new notifications.
*/
onChannelChatClear(user: UserIdResolvable, handler: (data: EventSubChannelChatClearEvent) => void): EventSubSubscription;
onChannelChatClear(broadcaster: UserIdResolvable, user: UserIdResolvable, handler: (data: EventSubChannelChatClearEvent) => void): EventSubSubscription;
/**
* Subscribes to events that represent a user's chat messages being cleared in a channel.
*
* @param user The user for which to get notifications about a user's chat messages being cleared in their channel.
* @param broadcaster The user for which to get notifications about a user's chat messages being cleared in their channel.
* @param user The user to use for reading the channel's chat.
* @param handler The function that will be called for any new notifications.
*/
onChannelChatClearUserMessages(user: UserIdResolvable, handler: (data: EventSubChannelChatClearUserMessagesEvent) => void): EventSubSubscription;
onChannelChatClearUserMessages(broadcaster: UserIdResolvable, user: UserIdResolvable, handler: (data: EventSubChannelChatClearUserMessagesEvent) => void): EventSubSubscription;
/**
* Subscribes to events that represent a chat message being deleted in a channel.
*
* @param user The user for which to get notifications about a chat message being deleted in their channel.
* @param broadcaster The user for which to get notifications about a chat message being deleted in their channel.
* @param user The user to use for reading the channel's chat.
* @param handler The function that will be called for any new notifications.
*/
onChannelChatMessageDelete(user: UserIdResolvable, handler: (data: EventSubChannelChatMessageDeleteEvent) => void): EventSubSubscription;
onChannelChatMessageDelete(broadcaster: UserIdResolvable, user: UserIdResolvable, handler: (data: EventSubChannelChatMessageDeleteEvent) => void): EventSubSubscription;
/**
* Subscribes to events that represent a chat notification being sent to a channel.
*
* @param broadcaster The user for which to get chat notifications in their channel.
* @param user The user to use for reading the channel's chat.
* @param handler The function that will be called for any new notifications.
*/
onChannelChatNotification(broadcaster: UserIdResolvable, user: UserIdResolvable, handler: (data: EventSubChannelChatNotificationEvent) => void): EventSubSubscription;
/**
* Subscribes to events that represent a drop entitlement being granted.

@@ -485,0 +497,0 @@ *

@@ -19,2 +19,3 @@ "use strict";

const EventSubChannelChatMessageDeleteSubscription_1 = require("./subscriptions/EventSubChannelChatMessageDeleteSubscription");
const EventSubChannelChatNotificationSubscription_1 = require("./subscriptions/EventSubChannelChatNotificationSubscription");
const EventSubChannelCheerSubscription_1 = require("./subscriptions/EventSubChannelCheerSubscription");

@@ -627,8 +628,10 @@ const EventSubChannelFollowSubscription_1 = require("./subscriptions/EventSubChannelFollowSubscription");

*
* @param user The user for which to get notifications about chat being cleared in their channel.
* @param broadcaster The user for which to get notifications about chat being cleared in their channel.
* @param user The user to use for reading the channel's chat.
* @param handler The function that will be called for any new notifications.
*/
onChannelChatClear(user, handler) {
onChannelChatClear(broadcaster, user, handler) {
const broadcasterId = this._extractUserIdWithNumericWarning(broadcaster, 'subscribeToChannelChatClearEvents');
const userId = this._extractUserIdWithNumericWarning(user, 'subscribeToChannelChatClearEvents');
return this._genericSubscribe(EventSubChannelChatClearSubscription_1.EventSubChannelChatClearSubscription, handler, this, userId);
return this._genericSubscribe(EventSubChannelChatClearSubscription_1.EventSubChannelChatClearSubscription, handler, this, broadcasterId, userId);
}

@@ -638,8 +641,10 @@ /**

*
* @param user The user for which to get notifications about a user's chat messages being cleared in their channel.
* @param broadcaster The user for which to get notifications about a user's chat messages being cleared in their channel.
* @param user The user to use for reading the channel's chat.
* @param handler The function that will be called for any new notifications.
*/
onChannelChatClearUserMessages(user, handler) {
onChannelChatClearUserMessages(broadcaster, user, handler) {
const broadcasterId = this._extractUserIdWithNumericWarning(broadcaster, 'subscribeToChannelChatClearUserMessagesEvents');
const userId = this._extractUserIdWithNumericWarning(user, 'subscribeToChannelChatClearUserMessagesEvents');
return this._genericSubscribe(EventSubChannelChatClearUserMessagesSubscription_1.EventSubChannelChatClearUserMessagesSubscription, handler, this, userId);
return this._genericSubscribe(EventSubChannelChatClearUserMessagesSubscription_1.EventSubChannelChatClearUserMessagesSubscription, handler, this, broadcasterId, userId);
}

@@ -649,10 +654,24 @@ /**

*
* @param user The user for which to get notifications about a chat message being deleted in their channel.
* @param broadcaster The user for which to get notifications about a chat message being deleted in their channel.
* @param user The user to use for reading the channel's chat.
* @param handler The function that will be called for any new notifications.
*/
onChannelChatMessageDelete(user, handler) {
onChannelChatMessageDelete(broadcaster, user, handler) {
const broadcasterId = this._extractUserIdWithNumericWarning(broadcaster, 'subscribeToChannelChatMessageDeleteEvents');
const userId = this._extractUserIdWithNumericWarning(user, 'subscribeToChannelChatMessageDeleteEvents');
return this._genericSubscribe(EventSubChannelChatMessageDeleteSubscription_1.EventSubChannelChatMessageDeleteSubscription, handler, this, userId);
return this._genericSubscribe(EventSubChannelChatMessageDeleteSubscription_1.EventSubChannelChatMessageDeleteSubscription, handler, this, broadcasterId, userId);
}
/**
* Subscribes to events that represent a chat notification being sent to a channel.
*
* @param broadcaster The user for which to get chat notifications in their channel.
* @param user The user to use for reading the channel's chat.
* @param handler The function that will be called for any new notifications.
*/
onChannelChatNotification(broadcaster, user, handler) {
const broadcasterId = this._extractUserIdWithNumericWarning(broadcaster, 'subscribeToChannelChatMessageDeleteEvents');
const userId = this._extractUserIdWithNumericWarning(user, 'subscribeToChannelChatMessageDeleteEvents');
return this._genericSubscribe(EventSubChannelChatNotificationSubscription_1.EventSubChannelChatNotificationSubscription, handler, this, broadcasterId, userId);
}
/**
* Subscribes to events that represent a drop entitlement being granted.

@@ -659,0 +678,0 @@ *

import { type HelixEventSubDropEntitlementGrantFilter } from '@twurple/api';
import type { UserIdResolvable } from '@twurple/common';
import { type EventSubChannelChatNotificationEvent } from './events/chatNotifications/EventSubChannelChatNotificationEvent';
import type { EventSubChannelAdBreakBeginEvent } from './events/EventSubChannelAdBreakBeginEvent';

@@ -396,21 +397,32 @@ import type { EventSubChannelBanEvent } from './events/EventSubChannelBanEvent';

*
* @param user The user for which to get notifications about chat being cleared in their channel.
* @param broadcaster The user for which to get notifications about chat being cleared in their channel.
* @param user The user to use for reading the channel's chat.
* @param handler The function that will be called for any new notifications.
*/
onChannelChatClear: (user: UserIdResolvable, handler: (data: EventSubChannelChatClearEvent) => void) => EventSubSubscription;
onChannelChatClear: (broadcaster: UserIdResolvable, user: UserIdResolvable, handler: (data: EventSubChannelChatClearEvent) => void) => EventSubSubscription;
/**
* Subscribes to events that represent a user's chat messages being cleared in a channel.
*
* @param user The user for which to get notifications about a user's chat messages being cleared in their channel.
* @param broadcaster The user for which to get notifications about a user's chat messages being cleared in their channel.
* @param user The user to use for reading the channel's chat.
* @param handler The function that will be called for any new notifications.
*/
onChannelChatClearUserMessages: (user: UserIdResolvable, handler: (data: EventSubChannelChatClearUserMessagesEvent) => void) => EventSubSubscription;
onChannelChatClearUserMessages: (broadcaster: UserIdResolvable, user: UserIdResolvable, handler: (data: EventSubChannelChatClearUserMessagesEvent) => void) => EventSubSubscription;
/**
* Subscribes to events that represent a chat message being deleted in a channel.
*
* @param user The user for which to get notifications about a chat message being deleted in their channel.
* @param broadcaster The user for which to get notifications about a chat message being deleted in their channel.
* @param user The user to use for reading the channel's chat.
* @param handler The function that will be called for any new notifications.
*/
onChannelChatMessageDelete: (user: UserIdResolvable, handler: (data: EventSubChannelChatMessageDeleteEvent) => void) => EventSubSubscription;
onChannelChatMessageDelete: (broadcaster: UserIdResolvable, user: UserIdResolvable, handler: (data: EventSubChannelChatMessageDeleteEvent) => void) => EventSubSubscription;
/**
* Subscribes to events that represent a chat notification being sent to a channel.
*
* @param broadcaster The user for which to get chat notifications in their channel.
* @param user The user to use for reading the channel's chat.
* @param handler The function that will be called for any new notifications.
*/
onChannelChatNotification: (broadcaster: UserIdResolvable, user: UserIdResolvable, handler: (data: EventSubChannelChatNotificationEvent) => void) => EventSubSubscription;
/**
* Subscribes to events that represent a drop entitlement being granted.

@@ -417,0 +429,0 @@ *

@@ -10,4 +10,5 @@ "use strict";

let EventSubChannelChatClearSubscription = class EventSubChannelChatClearSubscription extends EventSubSubscription_1.EventSubSubscription {
constructor(handler, client, _userId) {
constructor(handler, client, _broadcasterId, _userId) {
super(handler, client);
this._broadcasterId = _broadcasterId;
this._userId = _userId;

@@ -17,3 +18,3 @@ /** @protected */ this._cliName = 'chat-clear';

get id() {
return `channel.chat.clear.${this._userId}`;
return `channel.chat.clear.${this._broadcasterId}.${this._userId}`;
}

@@ -27,3 +28,3 @@ get authUserId() {

async _subscribe() {
return await this._client._apiClient.eventSub.subscribeToChannelChatClearEvents(this._userId, await this._getTransportOptions());
return await this._client._apiClient.asUser(this._userId, async (ctx) => await ctx.eventSub.subscribeToChannelChatClearEvents(this._broadcasterId, await this._getTransportOptions()));
}

@@ -30,0 +31,0 @@ };

@@ -10,4 +10,5 @@ "use strict";

let EventSubChannelChatClearUserMessagesSubscription = class EventSubChannelChatClearUserMessagesSubscription extends EventSubSubscription_1.EventSubSubscription {
constructor(handler, client, _userId) {
constructor(handler, client, _broadcasterId, _userId) {
super(handler, client);
this._broadcasterId = _broadcasterId;
this._userId = _userId;

@@ -17,3 +18,3 @@ /** @protected */ this._cliName = 'chat-clear-user-messages';

get id() {
return `channel.chat.clear_user_messages.${this._userId}`;
return `channel.chat.clear_user_messages.${this._broadcasterId}.${this._userId}`;
}

@@ -27,3 +28,3 @@ get authUserId() {

async _subscribe() {
return await this._client._apiClient.eventSub.subscribeToChannelChatClearUserMessagesEvents(this._userId, await this._getTransportOptions());
return await this._client._apiClient.asUser(this._userId, async (ctx) => await ctx.eventSub.subscribeToChannelChatClearUserMessagesEvents(this._broadcasterId, await this._getTransportOptions()));
}

@@ -30,0 +31,0 @@ };

@@ -10,4 +10,5 @@ "use strict";

let EventSubChannelChatMessageDeleteSubscription = class EventSubChannelChatMessageDeleteSubscription extends EventSubSubscription_1.EventSubSubscription {
constructor(handler, client, _userId) {
constructor(handler, client, _broadcasterId, _userId) {
super(handler, client);
this._broadcasterId = _broadcasterId;
this._userId = _userId;

@@ -17,3 +18,3 @@ /** @protected */ this._cliName = 'chat-message-delete';

get id() {
return `channel.chat.message_delete.${this._userId}`;
return `channel.chat.message_delete.${this._broadcasterId}.${this._userId}`;
}

@@ -27,3 +28,3 @@ get authUserId() {

async _subscribe() {
return await this._client._apiClient.eventSub.subscribeToChannelChatMessageDeleteEvents(this._userId, await this._getTransportOptions());
return await this._client._apiClient.asUser(this._userId, async (ctx) => await ctx.eventSub.subscribeToChannelChatMessageDeleteEvents(this._broadcasterId, await this._getTransportOptions()));
}

@@ -30,0 +31,0 @@ };

{
"name": "@twurple/eventsub-base",
"version": "7.1.0-pre.2",
"version": "7.1.0-pre.3",
"publishConfig": {

@@ -38,5 +38,5 @@ "access": "public"

"@d-fischer/typed-event-emitter": "^3.3.0",
"@twurple/api": "7.1.0-pre.2",
"@twurple/auth": "7.1.0-pre.2",
"@twurple/common": "7.1.0-pre.2",
"@twurple/api": "7.1.0-pre.3",
"@twurple/auth": "7.1.0-pre.3",
"@twurple/common": "7.1.0-pre.3",
"tslib": "^2.0.3"

@@ -43,0 +43,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc