Skip to content

Donation Integration (Regex)

This is the most powerful part and requires the most attention. Bearry reads the chat to identify donations from external platforms (like Livepix) through Regular Expressions (Regex).

Bearry monitors the chat. When a specific user (the donation bot) sends a message that matches the pattern (Regex) you defined, it extracts the value and adds time.

  1. Enable Donation: Check the “Enable Integration” switch.
  2. User Name (Bot): Type the exact name of the user sending the donation message in chat.
    • Example: Livepix, StreamElements, Nightbot.
    • Attention: Bearry will only read messages from this specific user to avoid fraud.
  3. Regular Expression (Regex): The code that “hunts” the value in the message.
  4. Time per Currency: How many seconds to add for each 1 unit of currency (e.g., each $1.00).

The Regex must have a Capture Group (...) around the numeric value. Bearry takes whatever is inside that group to know how much was donated.

Scenario 1: Livepix

  • Chat Message: Livepix: User John sent R$ 50,00 and said: Hello!
  • What we want to get: 50,00
  • Recommended Regex: R\$ (\d+[.,]\d{2})
    • R\$: Looks for the literal text “R$”.
    • : White space.
    • (\d+[.,]\d{2}): The Capture Group.
      • \d+: One or more digits (the 50).
      • [.,]: Dot OR comma.
      • \d{2}: Exactly two decimal digits (the 00).

Scenario 2: Simple Message

  • Chat Message: Donated 100 reais
  • Regex: Donated (\d+) reais

Scenario 3: Currency with Attached Symbol

  • Chat Message: User donated $10.50
  • Regex: \$(\d+\.?\d*)

We strongly recommend testing your Regex before the stream. Use these sites, paste your bot’s example message, and see if the Regex works (the value should appear as “Group 1”).

  1. Regex101 (Best option)
    • Select “ECMAScript (JavaScript)” in the sidebar menu.
  2. Regexr