@twurple/eventsub-base
Version:
Base for the other Twurple EventSub packages
44 lines (43 loc) • 1.52 kB
JavaScript
import { __decorate } from "tslib";
import { rawDataSymbol, rtfm } from '@twurple/common';
import { EventSubChannelBaseModerationEvent } from './EventSubChannelBaseModerationEvent.js';
/**
* An EventSub event representing a moderator banning a user in another channel during a shared chat session.
*/
let EventSubChannelSharedChatBanModerationEvent = class EventSubChannelSharedChatBanModerationEvent extends EventSubChannelBaseModerationEvent {
moderationAction = 'shared_chat_ban';
/**
* The ID of the user being banned.
*/
get userId() {
return this[rawDataSymbol].shared_chat_ban.user_id;
}
/**
* The name of the user being banned.
*/
get userName() {
return this[rawDataSymbol].shared_chat_ban.user_login;
}
/**
* The display name of the user being banned.
*/
get userDisplayName() {
return this[rawDataSymbol].shared_chat_ban.user_name;
}
/**
* Gets more information about the user.
*/
async getUser() {
return await this._client.users.getUserById(this[rawDataSymbol].shared_chat_ban.user_id);
}
/**
* The reason given for the ban.
*/
get reason() {
return this[rawDataSymbol].shared_chat_ban.reason;
}
};
EventSubChannelSharedChatBanModerationEvent = __decorate([
rtfm('eventsub-base', 'EventSubChannelSharedChatBanModerationEvent', 'broadcasterId')
], EventSubChannelSharedChatBanModerationEvent);
export { EventSubChannelSharedChatBanModerationEvent };