@twurple/eventsub-base
Version:
Base for the other Twurple EventSub packages
87 lines (86 loc) • 2.74 kB
JavaScript
import { __decorate } from "tslib";
import { Enumerable } from '@d-fischer/shared-utils';
import { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';
/**
* An EventSub event representing AutoMod terms being updated in a channel.
*/
let EventSubAutoModTermsUpdateEvent = class EventSubAutoModTermsUpdateEvent extends DataObject {
/** @internal */
constructor(data, client) {
super(data);
this._client = client;
}
/**
* The ID of the broadcaster in whose channel AutoMod terms were updated.
*/
get broadcasterId() {
return this[rawDataSymbol].broadcaster_user_id;
}
/**
* The name of the broadcaster in whose channel AutoMod terms were updated.
*/
get broadcasterName() {
return this[rawDataSymbol].broadcaster_user_login;
}
/**
* The display name of the broadcaster in whose channel AutoMod terms were updated.
*/
get broadcasterDisplayName() {
return this[rawDataSymbol].broadcaster_user_name;
}
/**
* Gets more information about the broadcaster.
*/
async getBroadcaster() {
return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].broadcaster_user_id));
}
/**
* The ID of the moderator who updated AutoMod terms.
*/
get moderatorId() {
return this[rawDataSymbol].moderator_user_id;
}
/**
* The name of the moderator who updated AutoMod terms.
*/
get moderatorName() {
return this[rawDataSymbol].moderator_user_login;
}
/**
* The display name of the moderator who updated AutoMod terms.
*/
get moderatorDisplayName() {
return this[rawDataSymbol].moderator_user_name;
}
/**
* Gets more information about the moderator.
*/
async getModerator() {
return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].moderator_user_id));
}
/**
* The status change applied to the terms.
*/
get action() {
return this[rawDataSymbol].action;
}
/**
* Indicates whether this term was added due to an AutoMod message resolution action.
*/
get fromAutoMod() {
return this[rawDataSymbol].from_automod;
}
/**
* The list of terms that had a status change.
*/
get terms() {
return this[rawDataSymbol].terms;
}
};
__decorate([
Enumerable(false)
], EventSubAutoModTermsUpdateEvent.prototype, "_client", void 0);
EventSubAutoModTermsUpdateEvent = __decorate([
rtfm('eventsub-base', 'EventSubAutoModTermsUpdateEvent', 'broadcasterId')
], EventSubAutoModTermsUpdateEvent);
export { EventSubAutoModTermsUpdateEvent };