const TwitchIO = require('twitchio-js');
const TwitchApi = new TwitchIO({
clientId: process.env.client_id,
authorizationKey: process.env.authorization_key
})
const cheerMotes = await TwitchApi.getCheerMotes()
const userInfo = await TwitchApi.getUserInfo("codinggarden")
// do something with the cheermotes and user info
const TwitchIO = require('twitchio-js');
const AuthenticatedApiHelper = new TwitchIO({
clientId: process.env.client_id,
authorizationKey: process.env.authorization_key
})
const moderators = await AuthenticatedApiHelper.getUserModerators("alca")
// get user info by username
const userInfo = await AuthenticatedApiHelper.getUserInfo("codinggarden");
// get user info by id
const userInfo = await AuthenticatedApiHelper.getUserInfo("413856795");
coming soon
const channelBadges = await AuthenticatedApiHelper.getBadgesByUsername("instafluff");
const copiedAuthenticatedApiHelper = AuthenticatedApiHelper.copy;
copiedAuthenticatedApiHelper.clientSecret = process.env.client_secret;
const refreshData = await copiedAuthenticatedApiHelper.refreshToken("refresh token");
const refreshData = await AuthenticatedApiHelper.refreshToken("refresh token", process.env.client_secret);
// get global cheermotes
const cheermotes = await copiedAuthenticatedApiHelper.getCheerMotes();
// get global cheermotes along with custom channel cheermotes
const customCheermotes = await copiedAuthenticatedApiHelper.getCheerMotes("413856795");
const TwitchIO = require('twitchio-js');
const UnAuthenticatedApiHelper = new TwitchIO({});
const channelBadges = await UnAuthenticatedApiHelper.getBadgesById("413856795");
const globalBadges = await UnAuthenticatedApiHelper.getGlobalBadges()
const {bttvEmotes, bttvRegex} = await UnAuthenticatedApiHelper.getBttvEmotes("codinggarden")
const { ffzEmotes, ffzRegex } = await UnAuthenticatedApiHelper.getFfzEmotes("codinggarden")
const channelsIModerate = await UnAuthenticatedApiHelper.getUserModerationChannels("dav1dsnyder404")