Fossabot Documentation

website·Indexed 32 days ago

https://docs.fossabot.com

Documentation for Fossabot, a Twitch moderation and automation bot. Includes guides on getting started, using keywords, managing nukes, and a comprehensive list of dynamic variables for inline text replacement, such as $(user), $(game), $(sender), and integration with external APIs like YouTube, X, and last.fm.

Tokens
24K
Snippets
189
Records
267
Agent score
60%

What's inside Fossabot

  1. Overview of Fossabot Nukes for mass moderation

    Nukes are a powerful moderation tool in Fossabot used to handle multiple offenses simultaneously. They allow moderators to mass ban users, apply timeouts, and delete messages based on pattern matching and regular expressions. Due to their destructive nature, nukes should only be accessible to trusted users who understand the risks, as improper usage can lead to a permanent ban from Fossabot.
  2. Overview of Fossabot Media Request feature

    Media request is a customizable feature in Fossabot that enables viewers to request media from YouTube or SoundCloud to be played on stream.
  3. Configure a backup playlist in Fossabot

    Fossabot includes a backup playlist feature that automatically picks songs at random when no viewer requests remain in the queue. By default, Fossabot provides a Monstercat Music playlist. Note that users are responsible for copyright compliance; for example, playing Monstercat music on stream requires a Monstercat Gold license.
  4. Access user data via Message HTTP Headers

    When a customapi request is triggered by a chat message, Fossabot includes additional headers containing information about the user who sent the message.
    HeaderDescription
    x-fossabot-message-idMessage ID from the provider (e.g., Twitch)
    x-fossabot-message-userloginLowercase sender username
    x-fossabot-message-userdisplaynameUppercase/internationalized sender username
    x-fossabot-message-userproviderPlatform the message was sent from
    x-fossabot-message-userprovideridPlatform ID of the sender
  5. Retrieve Twitch user metadata using the $(user) variable

    The $(user) variable and its members provide metadata about a Twitch user's channel. All $(user) variables take one optional parameter: a Twitch username. If no username is provided or hardcoded, it defaults to the sender of the command.

    Important Note for Timers: When used inside a timer, a valid Twitch username MUST be provided as the first parameter, otherwise the variable will return nothing because timers are executed by the bot rather than a specific user.

    // Example: Shoutout command
    Shout out to $(user.display_name)! Go follow them at twitch.tv/$(user.login) - they were last seen playing $(user.game)!
    
    // Example: Hardcoding a user (e.g., fossabot)
    Shout out to $(user.display_name fossabot)! Go follow them at twitch.tv/$(user.login fossabot)!
  6. Retrieve latest TikTok video metadata using $(tiktok)

    The $(tiktok) and $(tiktok.video) variables return metadata about a broadcaster's latest TikTok video. For these variables to work, the broadcaster must first authorize and connect their TikTok account via the Integrations tab on the Fossabot dashboard.

    Both variables support one optional parameter for custom formatting using the following placeholders:

    • {title}: The video's title
    • {description}: The video's description
    • {url}: The video's URL
    • {created}: The video's creation date
    • {duration}: The video's length
    • {like_count}: Number of likes
    • {comment_count}: Number of comments
    • {share_count}: Number of shares
    • {view_count}: Number of views
    • {id}: The video's unique identifier

    If no TikTok account is connected, the variable returns: [Error: TikTok authorization invalid. Please authorize on fossabot.com -> integrations]

    // Default output (Title - URL)
    $(tiktok)
    
    // Custom formatted output
    $(tiktok '{title}' currently has {view_count} views, {share_count} shares and {like_count} likes.)
  7. Retrieve detailed request context

    After validating a token, you can use the context_url to retrieve detailed information about the channel and the message that triggered the request. If the request was triggered by an automated action (like a timer), the message field will be null.
    GET https://api.fossabot.com/v2/customapi/context/<token>

    Example Response (200 OK):

    {
        "channel": {
            "id": "1",
            "login": "aiden",
            "display_name": "Aiden",
            "provider": "twitch",
            "provider_id": "87763385"
            // ... other channel fields
        },
        "message": {
            "id": "ae9a4e3e-d495-4d75-aec6-8965e7c4ccd0",
            "content": "!testcommand",
            "user": {
                "provider_id": "87763385",
                "login": "aiden",
                "roles": [ { "id": "1", "name": "Broadcaster", "type": "broadcaster" } ]
            }
        }
    }
  8. Use $(sender) variables to retrieve sender metadata

    The $(sender) variable family provides various metadata about the user who sent a message. These variables cannot be used inside Timers because Timers are executed by Fossabot on an interval rather than in response to a specific user message. Using these variables in a timer will result in the error: [Error: Cannot be executed inside of a timer].
  9. Retrieve sender's stream status and metrics

    Several variables provide real-time data about the sender's own Twitch channel. Note that $(sender.uptime) and $(sender.viewers) will return [Error: Stream is offline.] if the sender is not currently live.
    $(sender.game)    // Current directory (e.g., Just Chatting)
    $(sender.title)    // Current stream title
    $(sender.uptime)  // Time since going live (e.g., 3 hours and 25 minutes)
    $(sender.viewers)  // Current viewer count
    $(sender.views)    // Total profile views
    $(sender.followers)// Total follower count
  10. Configure automated responses using Fossabot Keywords

    Fossabot Keywords allow you to trigger specific responses based on the contents of a message, a username, or a combination of both. This is primarily used for chat moderation or answering frequently asked questions. Responses are triggered via 'phrase groups'; a response is executed only when all phrases within a specific phrase group are matched. All standard Fossabot variables are available for use within keyword responses.
  11. Get League of Legends rank and LP using $(leagueoflegends)

    The $(leagueoflegends) variable returns the current league points (LP) and rank of a League of Legends player. It requires two parameters: the account region and the player's Riot ID (formatted as Name#Tag). While legacy Summoner Names are currently supported, Riot IDs are the required standard.
    $(leagueoflegends <region> <Riot#ID>)
    
    Example: $(leagueoflegends kr Hide on bush#KR1)
    Output: Hide on bush is currently Grandmaster I 789 LP
  12. Manage Nuke results and rollbacks

    After a nuke is executed, Fossabot sends a whisper containing a link to a detailed report and the channel name. This report page allows you to:

    • ROLLBACK: Reverse the actions taken by the nuke.
    • COPY JSON: Copy the nuke information to your clipboard.