TwurpleAuthenticationGetting dataExamplesFAQMigration

Bot

Twitch chatbots made easy.

Overview

Constructor

new Bot(config)

Creates a new bot.

ParameterTypeRequiredDefaultDescription
configBotConfignone

The configuration for the bot.

Events

onAction((event) => { /* ... */ })

Fires when a user sends an action (/me) to a channel.

ParameterTypeDescription
eventMessageEvent

The event object.

onAnnouncement((event) => { /* ... */ })

Fires when a user sends an announcement (/announce) to a channel.

ParameterTypeDescription
eventAnnouncementEvent

The event object.

onAuthenticationFailure((text, retryCount) => { /* ... */ })

Fires when authentication fails.

ParameterTypeDescription
textstring

The message text.

retryCountnumber

The number of authentication attempts, including this one, that failed in the current attempt to connect.

Resets when authentication succeeds.

onAuthenticationSuccess(() => { /* ... */ })

Fires when authentication succeeds.

onBan((event) => { /* ... */ })

Fires when a user is permanently banned from a channel.

ParameterTypeDescription
eventBanEvent

The event object.

onBitsBadgeUpgrade((event) => { /* ... */ })

Fires when a user upgrades their bits badge in a channel.

ParameterTypeDescription
eventBitsBadgeUpgradeEvent

The event object.

onChatClear((event) => { /* ... */ })

Fires when the chat of a channel is cleared.

ParameterTypeDescription
eventChatClearEvent

The event object.

onCommunityPayForward((event) => { /* ... */ })

Fires when a user pays forward a subscription that was gifted to them to the community.

ParameterTypeDescription
eventCommunityPayForwardEvent

The event object.

onCommunitySub((event) => { /* ... */ })

Fires when a user gifts random subscriptions to the community of a channel.

Community subs also fire multiple onSubGift events. To prevent alert spam, check the example on how to handle sub gift spam.

ParameterTypeDescription
eventCommunitySubEvent

The event object.

onConnect(() => { /* ... */ })

Fires when the client successfully connects to the chat server.

onDisconnect((manually, reason) => { /* ... */ })

Fires when the client disconnects from the chat server.

ParameterTypeDescription
manuallyboolean

Whether the disconnect was requested by the user.

reasonError

The error that caused the disconnect, or undefined if there was no error.

onEmoteOnlyToggle((event) => { /* ... */ })

Fires when emote-only mode is toggled in a channel.

ParameterTypeDescription
eventEmoteOnlyToggleEvent

The event object.

onFollowersOnlyToggle((event) => { /* ... */ })

Fires when followers-only mode is toggled in a channel.

ParameterTypeDescription
eventFollowersOnlyToggleEvent

The event object.

onGiftPaidUpgrade((event) => { /* ... */ })

Fires when a user upgrades their gift subscription to a paid subscription in a channel.

ParameterTypeDescription
eventGiftPaidUpgradeEvent

The event object.

onJoin((event) => { /* ... */ })

Fires when a user joins a channel.

The join/leave events are cached by the Twitch chat server and will be batched and sent every 30-60 seconds.

Please note that if you have not enabled the requestMembershipEvents option or the channel has more than 1000 connected chatters, this will only react to your own joins.

ParameterTypeDescription
eventJoinEvent

The event object.

onJoinFailure((event) => { /* ... */ })

Fires when you fail to join a channel.

ParameterTypeDescription
eventJoinFailureEvent

The event object.

onLeave((event) => { /* ... */ })

Fires when a user leaves ("parts") a channel.

The join/leave events are cached by the Twitch chat server and will be batched and sent every 30-60 seconds.

Please note that if you have not enabled the requestMembershipEvents option or the channel has more than 1000 connected chatters, this will only react to your own leaves.

ParameterTypeDescription
eventLeaveEvent

The event object.

onMessage((event) => { /* ... */ })

Fires when a user sends a message to a channel.

ParameterTypeDescription
eventMessageEvent

The event object.

onMessageFailed((channel, reason) => { /* ... */ })

Fires when sending a message fails.

ParameterTypeDescription
channelstring

The channel that rejected the message.

reasonstring

The reason for the failure, e.g. you're banned (msg_banned)

onMessageRemove((event) => { /* ... */ })

Fires when a single message is removed from a channel.

ParameterTypeDescription
eventMessageRemoveEvent

The event object.

onPrimePaidUpgrade((event) => { /* ... */ })

Fires when a user upgrades their Prime subscription to a paid subscription in a channel.

ParameterTypeDescription
eventPrimePaidUpgradeEvent

The event object.

onRaid((event) => { /* ... */ })

Fires when a user raids a channel.

ParameterTypeDescription
eventRaidEvent

The event object.

onRaidCancel((event) => { /* ... */ })

Fires when a user cancels a raid.

ParameterTypeDescription
eventRaidCancelEvent

The event object.

onResub((event) => { /* ... */ })

Fires when a user resubscribes to a channel.

ParameterTypeDescription
eventSubEvent

The event object.

onSlowModeToggle((event) => { /* ... */ })

Fires when slow mode is toggled in a channel.

ParameterTypeDescription
eventSlowModeToggleEvent

The event object.

onStandardPayForward((event) => { /* ... */ })

Fires when a user pays forward a subscription that was gifted to them to a specific user.

ParameterTypeDescription
eventStandardPayForwardEvent

The event object.

onSub((event) => { /* ... */ })

Fires when a user subscribes to a channel.

ParameterTypeDescription
eventSubEvent

The event object.

onSubGift((event) => { /* ... */ })

Fires when a user gifts a subscription to a channel to another user.

Community subs also fire multiple onSubGift events. To prevent alert spam, check the example on how to handle sub gift spam.

ParameterTypeDescription
eventSubGiftEvent

The event object.

onSubsOnlyToggle((event) => { /* ... */ })

Fires when sub only mode is toggled in a channel.

ParameterTypeDescription
eventSubsOnlyToggleEvent

The event object.

onTimeout((event) => { /* ... */ })

Fires when a user is timed out from a channel.

ParameterTypeDescription
eventBanEvent

The event object.

onTokenFetchFailure((error) => { /* ... */ })

Fires when fetching a token fails.

ParameterTypeDescription
errorError

The error that was thrown.

onUniqueChatToggle((event) => { /* ... */ })

Fires when unique chat mode is toggled in a channel.

ParameterTypeDescription
eventUniqueChatToggleEvent

The event object.

onWhisper((event) => { /* ... */ })

Fires when receiving a whisper from another user.

ParameterTypeDescription
eventWhisperEvent

The event object.

Properties

api

Type: ApiClient

Direct access to the underlying API client. Use at your own risk.

chat

Type: ChatClient

Direct access to the underlying chat client. Use at your own risk.

Methods

action(channelName, text)

async

Sends an action (/me) to the given channel.

ParameterTypeRequiredDefaultDescription
channelNamestringnone

The name of the channel to send the action to.

textstringnone

The text to send.

Return type: void

addVip(channelName, userName)

async

Gives a user VIP status in the given channel.

ParameterTypeRequiredDefaultDescription
channelNamestringnone

The name of the channel to give the user VIP status in.

userNamestringnone

The name of the user to give VIP status.

Return type: void

addVipByIds(channel, user)

async

Gives a user VIP status in the given channel using the channel and user IDs.

ParameterTypeRequiredDefaultDescription
channel
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The channel to give the user VIP status in.

user
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The user to give VIP status.

Return type: void

announce(channelName, text, color)

async

Sends an announcement to the given channel.

ParameterTypeRequiredDefaultDescription
channelNamestringnone

The name of the channel to send the announcement to.

textstringnone

The text to send.

color
ChatAnnouncementColor

Aliased type:

HelixChatAnnouncementColor

The color used to highlight an announcement.

Aliased type: "blue" | "green" | "orange" | "purple" | "primary"

none

The color to send the announcement in. If not passed, uses the default channel color.

Return type: void

announceById(channel, text, color)

async

Sends an announcement to the given channel using its ID.

ParameterTypeRequiredDefaultDescription
channel
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The channel to send the announcement to.

textstringnone

The text to send.

color
ChatAnnouncementColor

Aliased type:

HelixChatAnnouncementColor

The color used to highlight an announcement.

Aliased type: "blue" | "green" | "orange" | "purple" | "primary"

none

The color to send the announcement in. If not passed, uses the default channel color.

Return type: void

ban(channelName, userName, reason)

async

Bans a user from the given channel.

ParameterTypeRequiredDefaultDescription
channelNamestringnone

The name of the channel to ban the user from.

userNamestringnone

The name of the user to ban.

reasonstringnone

The reason for the ban.

Return type: void

banByIds(channel, user, reason)

async

Bans a user from the given channel using the channel and user IDs.

ParameterTypeRequiredDefaultDescription
channel
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The channel to ban the user from.

user
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The user to ban.

reasonstringnone

The reason for the ban.

Return type: void

changeColor(color)

async

Changes the bot's username color.

ParameterTypeRequiredDefaultDescription
colorChatUserColornone

The hexadecimal code (prefixed with #) or color name to use for your username.

Please note that only Twitch Turbo or Prime users can use hexadecimal codes for arbitrary colors.

If you have neither of those, you can only choose from the following color names:

blue, blue_violet, cadet_blue, chocolate, coral, dodger_blue, firebrick, golden_rod, green, hot_pink, orange_red, red, sea_green, spring_green, yellow_green

Return type: void

clear(channelName)

async

Removes all messages from the given channel.

ParameterTypeRequiredDefaultDescription
channelNamestringnone

The name of the channel to remove all messages from.

Return type: void

clearById(channel)

async

Removes all messages from the given channel using its ID.

ParameterTypeRequiredDefaultDescription
channel
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The channel to remove all messages from.

Return type: void

deleteMessage(channelName, message)

async

Deletes a message from the given channel.

ParameterTypeRequiredDefaultDescription
channelNamestringnone

The name of the channel to delete the message from.

messagestring | ChatMessagenone

The message (as message ID or message object) to delete.

Return type: void

deleteMessageById(channel, message)

async

Deletes a message from the given channel using the channel ID.

ParameterTypeRequiredDefaultDescription
channel
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The channel to delete the message from.

messagestring | ChatMessagenone

The message (as message ID or message object) to delete.

Return type: void

disableEmoteOnly(channelName)

async

Disables emote-only mode in the given channel.

ParameterTypeRequiredDefaultDescription
channelNamestringnone

The name of the channel to disable emote-only mode in.

Return type: void

disableEmoteOnlyById(channel)

async

Disables emote-only mode in the given channel using its ID.

ParameterTypeRequiredDefaultDescription
channel
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The channel to disable emote-only mode in.

Return type: void

disableFollowersOnly(channelName)

async

Disables followers-only mode in the given channel.

ParameterTypeRequiredDefaultDescription
channelNamestringnone

The name of the channel to disable followers-only mode in.

Return type: void

disableFollowersOnlyById(channel)

async

Disables followers-only mode in the given channel using its ID.

ParameterTypeRequiredDefaultDescription
channel
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The channel to disable followers-only mode in.

Return type: void

disableSlowMode(channelName)

async

Disables slow mode in the given channel.

ParameterTypeRequiredDefaultDescription
channelNamestringnone

The name of the channel to disable slow mode in.

Return type: void

disableSlowModeById(channel)

async

Disables slow mode in the given channel using its ID.

ParameterTypeRequiredDefaultDescription
channel
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The channel to disable slow mode in.

Return type: void

disableSubsOnly(channelName)

async

Disables subscribers-only mode in the given channel.

ParameterTypeRequiredDefaultDescription
channelNamestringnone

The name of the channel to disable subscribers-only mode in.

Return type: void

disableSubsOnlyById(channel)

async

Disables subscribers-only mode in the given channel using its ID.

ParameterTypeRequiredDefaultDescription
channel
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The channel to disable subscribers-only mode in.

Return type: void

disableUniqueChat(channelName)

async

Disables unique chat mode in the given channel.

ParameterTypeRequiredDefaultDescription
channelNamestringnone

The name of the channel to disable unique chat mode in.

Return type: void

disableUniqueChatById(channel)

async

Disables unique chat mode in the given channel using its ID.

ParameterTypeRequiredDefaultDescription
channel
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The channel to disable unique chat mode in.

Return type: void

enableEmoteOnly(channelName)

async

Enables emote-only mode in the given channel.

ParameterTypeRequiredDefaultDescription
channelNamestringnone

The name of the channel to enable emote-only mode in.

Return type: void

enableEmoteOnlyById(channel)

async

Enables emote-only mode in the given channel using its ID.

ParameterTypeRequiredDefaultDescription
channel
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The channel to enable emote-only mode in.

Return type: void

enableFollowersOnly(channelName, minFollowTime)

async

Enables followers-only mode in the given channel.

ParameterTypeRequiredDefaultDescription
channelNamestringnone

The name of the channel to enable followers-only mode in.

minFollowTimenumber0

The time (in minutes) a user needs to be following before being able to send messages.

Return type: void

enableFollowersOnlyById(channel, minFollowTime)

async

Enables followers-only mode in the given channel using its ID.

ParameterTypeRequiredDefaultDescription
channel
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The channel to enable followers-only mode in.

minFollowTimenumber0

The time (in minutes) a user needs to be following before being able to send messages.

Return type: void

enableSlowMode(channelName, delayBetweenMessages)

async

Enables slow mode in the given channel.

ParameterTypeRequiredDefaultDescription
channelNamestringnone

The name of the channel to enable slow mode in.

delayBetweenMessagesnumber30

The time (in seconds) a user needs to wait between messages.

Return type: void

enableSlowModeById(channel, delayBetweenMessages)

async

Enables slow mode in the given channel using its ID.

ParameterTypeRequiredDefaultDescription
channel
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The channel to enable slow mode in.

delayBetweenMessagesnumber30

The time (in seconds) a user needs to wait between messages.

Return type: void

enableSubsOnly(channelName)

async

Enables subscribers-only mode in the given channel.

ParameterTypeRequiredDefaultDescription
channelNamestringnone

The name of the channel to enable subscribers-only mode in.

Return type: void

enableSubsOnlyById(channel)

async

Enables subscribers-only mode in the given channel using its ID.

ParameterTypeRequiredDefaultDescription
channel
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The channel to enable subscribers-only mode in.

Return type: void

enableUniqueChat(channelName)

async

Enables unique chat mode in the given channel.

ParameterTypeRequiredDefaultDescription
channelNamestringnone

The name of the channel to enable unique chat mode in.

Return type: void

enableUniqueChatById(channel)

async

Enables unique chat mode in the given channel using its ID.

ParameterTypeRequiredDefaultDescription
channel
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The channel to enable unique chat mode in.

Return type: void

getMods(channelName)

async

Retrieves a list of moderators in the given channel.

ParameterTypeRequiredDefaultDescription
channelNamestringnone

The name of the channel to retrieve the moderators of.

Return type: HelixModerator[]

getModsById(channel)

async

Retrieves a list of moderators in the given channel using its ID.

ParameterTypeRequiredDefaultDescription
channel
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The channel to retrieve the moderators of.

Return type: HelixModerator[]

getVips(channelName)

async

Retrieves a list of VIPs in the given channel.

ParameterTypeRequiredDefaultDescription
channelNamestringnone

The name of the channel to retrieve the VIPs of.

Return type: HelixUserRelation[]

getVipsById(channel)

async

Retrieves a list of VIPs in the given channel using its ID.

ParameterTypeRequiredDefaultDescription
channel
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The channel to retrieve the VIPs of.

Return type: HelixUserRelation[]

join(channelName)

async

Joins a channel.

ParameterTypeRequiredDefaultDescription
channelNamestringnone

The name of the channel to join.

Return type: void

leave(channelName)

Leaves a channel.

ParameterTypeRequiredDefaultDescription
channelNamestringnone

The name of the channel to leave.

Return type: void

mod(channelName, userName)

async

Gives a user moderator rights in the given channel.

ParameterTypeRequiredDefaultDescription
channelNamestringnone

The name of the channel to give the user moderator rights in.

userNamestringnone

The name of the user to give moderator rights to.

Return type: void

modByIds(channel, user)

async

Gives a user moderator rights in the given channel using the channel and user IDs.

ParameterTypeRequiredDefaultDescription
channel
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The channel to give the user moderator rights in.

user
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The user to give moderator rights to.

Return type: void

purge(channelName, userName, reason)

async

Removes all messages of a user from the given channel.

ParameterTypeRequiredDefaultDescription
channelNamestringnone

The name of the channel to purge the user's messages from.

userNamestringnone

The name of the user to purge.

reasonstring''

The reason for the purge.

Return type: void

purgeByIds(channel, user, reason)

async

Removes all messages of a user from the given channel using the channel and user IDs.

ParameterTypeRequiredDefaultDescription
channel
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The channel to purge the user's messages from.

user
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The user to purge.

reasonstring''

The reason for the purge.

Return type: void

removeVip(channelName, userName)

async

Takes VIP status from a user in the given channel.

ParameterTypeRequiredDefaultDescription
channelNamestringnone

The name of the channel to take the user's VIP status in.

userNamestringnone

The name of the user to take VIP status from.

Return type: void

removeVipByIds(channel, user)

async

Takes VIP status from a user in the given channel using the channel and user IDs.

ParameterTypeRequiredDefaultDescription
channel
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The channel to take the user's VIP status in.

user
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The user to take VIP status from.

Return type: void

reply(channel, text, replyToMessage)

async

Sends a reply to another chat message to the given channel.

ParameterTypeRequiredDefaultDescription
channelstringnone

The channel to send the message to.

textstringnone

The text to send.

replyToMessagestring | ChatMessagenone

The message (or ID of the message) to reply to.

Return type: void

runCommercial(channelName, length)

async

Runs a commercial break on the given channel.

ParameterTypeRequiredDefaultDescription
channelNamestringnone

The name of the channel to run the commercial break on.

length
CommercialLength

The possible lengths of a channel commercial.

Aliased type: 30 | 60 | 90 | 120 | 150 | 180

30

The duration of the commercial break.

Return type: void

runCommercialById(channel, length)

async

Runs a commercial break on the given channel using its ID.

ParameterTypeRequiredDefaultDescription
channel
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The channel to run the commercial break on.

length
CommercialLength

The possible lengths of a channel commercial.

Aliased type: 30 | 60 | 90 | 120 | 150 | 180

30

The duration of the commercial break.

Return type: void

say(channel, text, attributes)

async

Sends a regular chat message to the given channel.

ParameterTypeRequiredDefaultDescription
channelstringnone

The channel to send the message to.

textstringnone

The text to send.

attributesChatSayMessageAttributes<complex>

The attributes to add to the message.

Return type: void

timeout(channelName, userName, duration, reason)

async

Times out a user in the given channel and removes all their messages.

ParameterTypeRequiredDefaultDescription
channelNamestringnone

The name of the channel to time out the user in.

userNamestringnone

The name of the user to time out.

durationnumber60

The time (in seconds) until the user can send messages again. Defaults to 1 minute.

reasonstring''

The reason for the timeout.

Return type: void

timeoutByIds(channel, user, duration, reason)

async

Times out a user in the given channel and removes all their messages using the channel and user IDs.

ParameterTypeRequiredDefaultDescription
channel
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The channel to time out the user in.

user
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The user to time out.

durationnumber60

The time (in seconds) until the user can send messages again. Defaults to 1 minute.

reasonstring''

The reason for the timeout.

Return type: void

unban(channelName, userName)

async

Unban a user from the given channel.

ParameterTypeRequiredDefaultDescription
channelNamestringnone

The name of the channel to unban the user from.

userNamestringnone

The name of the user to unban.

Return type: void

unbanByIds(channel, user)

async

Unbans a user from the given channel using the channel and user IDs.

ParameterTypeRequiredDefaultDescription
channel
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The channel to unban the user from.

user
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The user to unban.

Return type: void

unmod(channelName, userName)

async

Takes moderator rights from a user in the given channel.

ParameterTypeRequiredDefaultDescription
channelNamestringnone

The name of the channel to remove the user's moderator rights in.

userNamestringnone

The name of the user to take moderator rights from.

Return type: void

unmodByIds(channel, user)

async

Takes moderator rights from a user in the given channel using the channel and user IDs.

ParameterTypeRequiredDefaultDescription
channel
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The channel to remove the user's moderator rights in.

user
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The user to take moderator rights from.

Return type: void

whisper(targetName, text)

async

Sends a whisper message to the given user.

ParameterTypeRequiredDefaultDescription
targetNamestringnone

The name of the user to send the whisper message to.

textstringnone

The text to send.

Return type: void

whisperById(target, text)

async

Sends a whisper message to the given user using their ID.

ParameterTypeRequiredDefaultDescription
target
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The user to send the whisper message to.

textstringnone

The text to send.

Return type: void