Skip to content

The {charity.*} helpers read the charity campaign that is running on your Twitch channel. They work in a command reply, an event response, a timer, a pipeline step, a Discord notification and a webhook body. They do not work in a viewer’s own text, even with Viewer Templates on in Features. If you have not used braces in a reply yet, read Variables and templates first.

The bot asks Twitch for the campaign each time a reply uses these helpers, so the reply shows the amount at that moment. None of these helpers takes an input, so type each one exactly as shown.

The Twitch permission they need

To read your campaign, the bot needs your Twitch permission channel:read:charity. Your first Twitch sign-in does not ask for it, because the bot asks for extra Twitch permissions only when a feature needs them. Until the permission is granted, every charity helper prints as typed, and the rest of the reply still shows.

When the bot finds that the permission is missing, the Needs attention list on your Home page shows Twitch permission missing: channel:read:charity. The bot finds it in two ways:

  • Twitch refuses the bot’s charity event feeds for your channel.
  • A reply uses a charity helper without the permission. The bot records the gap the first time this happens.

When that first reply came from chat, a timer or an event, the bot also says once in chat that it needs this permission. So type your charity command once in your channel’s chat before a charity stream, and then look at Needs attention.

The item has a Dismiss button. A dismissed item stays hidden until the permission is given, so an empty list does not prove that the bot has the permission.

Grant the permission

When the bot found the gap through a reply, the Needs attention item says “Grant it on the Integrations page”. When Twitch refused the event feeds, the item says “Grant the permission to get them back” after the list of refused feeds. A Moderator and up sees Grant permissions on the Integrations page and can start the request. The bot saves the permission on the Twitch account that approves the code. To grant it for the channel, approve the code while you are signed in to Twitch as the streamer’s own account.

  1. Open Settings, then Integrations. The page opens with a notice that reads “1 more Twitch permission to grant”, or a higher count. The notice lists channel:read:charity among the permissions.
  2. Choose Grant permissions. The notice shows “Enter this code on Twitch:” and a code, with a link to Twitch.
  3. Open the link, enter the code, and approve the permissions on Twitch.

While the code is open, the notice shows the code and the line “Waiting for you to approve on Twitch. This page updates by itself.” The Grant permissions button is hidden during this wait.

The grant adds the missing permissions and keeps everything you already allowed. If the request fails, the notice shows “The permission request failed. Try again.”

After you approve on Twitch, the notice stays and its title reads “Permissions granted. Twitch now lets the bot use them.” It does not go away at once. From then on, the charity helpers show their values.

If the grant does not finish, the notice says why and offers Grant permissions again for a new code:

  • The code ran out: “The code ran out before it was used. Grant the permissions again for a new code.”
  • Twitch did not get your approval: “Twitch did not get your approval. Grant the permissions again to try once more.”
  • The bot could not check the approval: “The approval could not be checked. Grant the permissions again to try once more.”

When a helper prints its braces

When a helper has nothing to show, it prints exactly as you typed it, braces and all. Check these causes in order.

CauseHow to tell
The bot does not have the permissionNeeds attention shows Twitch permission missing: channel:read:charity. If you dismissed that item before, this cause is still possible
No campaign is runningTwitch shows no running campaign on your channel
Twitch did not answerYour campaign is running on Twitch and the bot has the permission. The next reply asks Twitch again

Campaign progress

HelperWhat it givesExample
{charity.name}The name of the charitySample Charity
{charity.link}The website of the charity. It prints as typed when the charity has nonehttps://www.samplecharity.org
{charity.raised}The money raised so far, with its currency€420.00
{charity.target}The money target of the campaign, with its currency€1,000.00
{charity.percent}The money raised as a percent of the target, rounded to a whole number. It goes above 100% once you pass the target. It prints as typed when the target is 042%
{charity.bar}A bar of 10 blocks that fills as you get closer to the target, followed by the percent. The bar stays full once you pass the target. It prints as typed when the target is 0████░░░░░░ 42%

In words, the example bar is four filled blocks, then six pale blocks, then 42%. Each filled block stands for one tenth of the target, rounded to the nearest block.

Amounts show the currency symbol and the decimal places Twitch gives. The digit grouping follows your channel’s language, so English gives €1,000.00. That language is the Language field in Settings, under Bot basics, described on Bot basics and personality. With no language set, amounts use English grouping. When a currency has no known symbol, its code follows the amount, as in 420.00 XYZ.

Donations

HelperWhat it givesExample
{charity.donations.count}How many donations the campaign has, up to 100. A campaign with more than 100 donations still shows 10017
{charity.donations.latest}The newest donation: the name of the donor, with the amount in bracketsViewerOne (€10.00)

When the campaign has no donations yet, {charity.donations.count} gives 0 and {charity.donations.latest} prints as typed.

Progress and the newest donation in one reply

A !charity command can show how far the campaign is and thank the latest donor:

{charity.name}: {charity.raised} of {charity.target} {charity.bar}. Thank you, {charity.donations.latest}!

This gives Sample Charity: €420.00 of €1,000.00 ████░░░░░░ 42%. Thank you, ViewerOne (€10.00)!.

At the start of a campaign, before the first donation, the same reply gives Sample Charity: €0.00 of €1,000.00 ░░░░░░░░░░ 0%. Thank you, {charity.donations.latest}!. To avoid that, leave out the thank-you until the first donation comes in:

{charity.name}: {charity.raised} of {charity.target} {charity.bar}

With no campaign running, {charity.name}, {charity.raised}, {charity.target} and {charity.bar} print as typed, so use the command only on your charity streams. Switch the command on from its row on the Commands page, or from the Enabled switch at the top of the editor, as described in Switch a command off.

Back to Template helpers.