Socket
Book a DemoInstallSign in
Socket

tiltify

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tiltify

Tiltify API Interface

latest
Source
npmnpm
Version
0.3.0
Version published
Maintainers
1
Created
Source

Tiltify 0.3.0

This helper for Tiltify is meant to act as an extension streamers' twitch bots in order to make interfacing with the Tiltify Donations platform more easily.

If you like what you see, consider visiting my patreon, or visit my twitch page for a paypal donation link.

This is under VERY heavy development. Please visit GitHub for up-to-date developments as we push toward release.

What's New in 0.3 Alpha?

Causes Module Implemented with Fetch Endpoint to begin with, further functionality to come. (Documentation is slightly behind here) This "fetch" protocol to acquire individual information bits such as name, description, etc. about individual campaigns.

Installation

npm install tiltify

Implementation

Includes

const tiltify = require(`tiltify`);
const config = require('./config');         // Great to store variables safely
const tmi = require('tmi.js');              // Recommended for chat functionality, though not strictly necessary to function.
const client = new tmi.client(config);

Implement and Call the Class

let tiltifyOpts = {
    access_token: `************************************************`,
    campaign_id: `*****`
}
const Tiltify = require(`tiltify`);
// Call once per command
const tiltify = new Tiltify(tiltifyOpts.access_token);

USE

Campaigns

tiltify.Campaigns.getLastDonation(tiltifyOpts.campaign_id, function (err, result) {
        if (result.comment) {
            client.action(channel, `Last Donation: ${result.name} donated $${result.amount}! "${result.comment}"`)
        } else {
            client.action(channel, `Last Donation: ${result.name} donated $${result.amount}! curseLit`)
        }
});
tiltify.Campaigns.getRewards(tiltifyOpts.campaign_id, function (err, result) {
    result.forEach((data) => {
        client.action(channel, `${data.name} Unlocked! ${data.remaining} Remain to be claimed! curseLit`)
    }
});

Fetch Protocol (Campaigns)

Option 1 [multi-point fetch]

tiltify.Campaigns.fetch(campaign_id, function (err, campaign) {
    client.action(channel, `Welcome To ${campaign.name}! Donate here: ${campaign.url}`)
});

Option 2 [Single-point fetch]

tiltify.Campaigns.fetch(`name`, tiltifyOpts.campaign_id, function (err, result) {
        client.action(channel, `Currently Raising Money for ${data}! Donate at the link below.`)
});

Causes

tiltify.Causes.fetch(campaign.causeId, function (err, cause) {
    client.action(channel, `${channel.slice(1)} is currently Raising Money for ${cause.name} as part of the ${campaign.name}! ${cause.about}`)
})

Developed by Cazgem for personal use at (https://twitch.tv/cazgem) as well as for his chatbot, Polyphony.

Started: Oct 18, 2020

FAQs

Package last updated on 28 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.