Skip to content

Ban

Represents a ban in a chatroom.

Extends

  • Base<T>

Type parameters

Type parameter
T extends EventSubConnection

Constructors

new Ban()

1
new Ban<T>(chatbot: ChatBot<T>, data: Ban): Ban<T>

Creates a new instance of the ban.

Parameters

ParameterTypeDescription
chatbotChatBot<T>The current instance of the chatbot.
dataBanThe data of the ban returned from the API.

Returns

Ban<T>

Overrides

Base<T>.constructor

Source

twitchfy/packages/chatbot/src/structures/Ban.ts:31

Properties

PropertyModifierTypeDescriptionInherited from
chatbotreadonlyChatBot<T>The current instance of the chatbot.Base.chatbot
moderatorIdreadonlystringThe Id of the moderator who banned the user.-
userIdreadonlystringThe Id of the user who was banned.-

Accessors

chatroomId

1
get chatroomId(): string

The Id of the chatroom where the ban was made.

Returns

string

Source

twitchfy/packages/chatbot/src/structures/Ban.ts:49


createdAt

1
get createdAt(): Date

The Date when the ban was created. Returns a JavaScript Date object.

Returns

Date

Source

twitchfy/packages/chatbot/src/structures/Ban.ts:56


endTime

1
get endTime(): null | Date

If the ban is a timeout this will return the end time of the timeout in a JavaScript Date object. If not, it will return a nullish value.

Returns

null | Date

Source

twitchfy/packages/chatbot/src/structures/Ban.ts:63

Methods

delete()

1
delete(): Promise<void>

Deletes the ban from the chatroom.

Returns

Promise<void>

Source

twitchfy/packages/chatbot/src/structures/Ban.ts:42