@twurple/eventsub-base
Version:
Base for the other Twurple EventSub packages
38 lines (37 loc) • 1.28 kB
JavaScript
import { __decorate } from "tslib";
import { rawDataSymbol, rtfm } from '@twurple/common';
import { EventSubChannelBaseModerationEvent } from './EventSubChannelBaseModerationEvent.js';
/**
* An EventSub event representing a user having lost moderator status on a channel.
*/
let EventSubChannelUnmodModerationEvent = class EventSubChannelUnmodModerationEvent extends EventSubChannelBaseModerationEvent {
moderationAction = 'unmod';
/**
* The ID of the user losing mod status.
*/
get userId() {
return this[rawDataSymbol].unmod.user_id;
}
/**
* The name of the user losing mod status.
*/
get userName() {
return this[rawDataSymbol].unmod.user_login;
}
/**
* The display name of the user losing mod status.
*/
get userDisplayName() {
return this[rawDataSymbol].unmod.user_name;
}
/**
* Gets more information about the user.
*/
async getUser() {
return await this._client.users.getUserById(this[rawDataSymbol].unmod.user_id);
}
};
EventSubChannelUnmodModerationEvent = __decorate([
rtfm('eventsub-base', 'EventSubChannelUnmodModerationEvent', 'broadcasterId')
], EventSubChannelUnmodModerationEvent);
export { EventSubChannelUnmodModerationEvent };