@twurple/eventsub-base
Version:
Base for the other Twurple EventSub packages
44 lines (43 loc) • 1.35 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 on a channel.
*/
let EventSubChannelBanModerationEvent = class EventSubChannelBanModerationEvent extends EventSubChannelBaseModerationEvent {
moderationAction = 'ban';
/**
* The ID of the user being banned.
*/
get userId() {
return this[rawDataSymbol].ban.user_id;
}
/**
* The name of the user being banned.
*/
get userName() {
return this[rawDataSymbol].ban.user_login;
}
/**
* The display name of the user being banned.
*/
get userDisplayName() {
return this[rawDataSymbol].ban.user_name;
}
/**
* Gets more information about the user.
*/
async getUser() {
return await this._client.users.getUserById(this[rawDataSymbol].ban.user_id);
}
/**
* The reason given for the ban.
*/
get reason() {
return this[rawDataSymbol].ban.reason;
}
};
EventSubChannelBanModerationEvent = __decorate([
rtfm('eventsub-base', 'EventSubChannelBanModerationEvent', 'broadcasterId')
], EventSubChannelBanModerationEvent);
export { EventSubChannelBanModerationEvent };