npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

twitch-tools-vx

v1.0.1

Published

This project is a library/module that provides additional functionalities for interacting with the Twitch API, complementing the Vitor-VX/Twitch-Tools library and much more.

Downloads

4

Readme

TwitchToolsVX - New Implementations

This project is a library/module that provides additional functionalities for interacting with the Twitch API, complementing the Vitor-VX/Twitch-Tools library and much more.

  • The library includes all the features/functions from the twitch-moderation-tools, library, making it an add-on to this library.

Examples:


const Twitch = require("twitch-tools-vx");

const TwitchTools = new Twitch('__TOKEN__', '__CLIENT-ID__');

TwitchTools.TwitchModeration.AddBlockedTerm();
TwitchTools.TwitchModeration.BanUser();
TwitchTools.TwitchModeration.TimeoutUser();

Functionalities

SetTitleLive(authTokenMain, channel, title, botChannel = false)

Sets the title of a live stream.

Usage Example:

SetTitleLive('authToken', 'channelName', 'New Live Title');

SetTegLive(authTokenMain, channel, teg, botChannel = false)

Sets the tag of a live stream.

Usage Example:

SetTegLive('authToken', 'channelName', 'new-tag');

GetTokenTwitchDevice(waitTimeInSeconds, scopes = [])

Obtains an authentication token using the Twitch device OAuth flow.

Usage Example:

GetTokenTwitchDevice(30, ['channel:manage:broadcast']);

RefreshToken(refreshToken, clientSecret)

Refreshes an authentication token using a refresh token.

Usage Example:

RefreshToken('refreshToken', 'clientSecret');

StreamerIsLive(streamer)

Checking whether a streamer is online or offline, returns true for online and false for offline

Usage Example:

StreamerIsLive('jvzx_'); // return false

Additional Functionalities

In addition to the functionalities mentioned above, this library also includes custom features that I developed myself and that can be useful, such as:

  • RemoveSpamCaules(channel, botModerator, message, tags): Removes messages containing spam keywords.
  • BanSpamCaules(channel, botModerator, userBanned, message): Bans users who sent messages containing spam keywords.
  • RemoveMessageSwearWord(channel, botModerator, tags, message): Removes messages containing swear words.
  • BanSwearWord(channel, botModerator, userBanned, message): Bans users who sent messages containing swear words.

These additional functionalities were developed by myself using custom libraries like npm i swearguard-vx, which checks for swear words in strings, and are "not part of" the standard Twitch functionalities.

These functionalities are useful for moderating and managing live streams on the Twitch platform. The TwitchToolsVX class provides a convenient interface for interacting with the Twitch API and performing various moderation and content management operations.

Installation

To install the library, you can use npm. Run the following command:

npm i twitch-tools-vx

Important

To use the SetTitleLive or SetTegLive functions, you need to obtain the token of the channel you want to modify. This is because Twitch separates functionalities between those that a token can perform and those that can only be performed with the token of the specific channel. For example, if my bot is called StreamSquawk and I want to change the title or tag of the channel called jvzx_, I can only do that with the token of the jvzx_ channel, not with the token of StreamSquawk.

If you want to obtain the CHANNEL token to use both functions, use the following scope:

scope=channel:manage:broadcast

For example, if I use both functions to try to change the title or tag of the live stream using the token of my bot StreamSquawk, the title or tag will be changed in the CHANNEL of my bot.

Observação - PT-BR

A documentação completa em português-br está disponível na pasta docs/ptbr.