<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Cradicle Explorer</title>
    <link href="/css/bootstrap/bootstrap.min.css" rel="stylesheet">
    <style>
      .form-control-dark::placeholder {
          color: #aaa;
          opacity: 1;
      }
    </style>
    <link rel="stylesheet" href="/assets/fontawesome/css/all.min.css">
    <link rel="icon" type="image/png" href="/favicon.png">


                <link href="/css/dashboard.css" rel="stylesheet">
                </head>
                <body>
                <header class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0 shadow">
                  <a class="navbar-brand col-md-3 col-lg-2 me-0 px-3 fs-6" href="/">Cradicle Explorer</a>
                  <button class="navbar-toggler position-absolute d-md-none collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#sidebarMenu" aria-controls="sidebarMenu" aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                  </button>
                  <form method="get" action="/cgi-bin/main" style="width:100%;"><input class="form-control form-control-dark w-100 rounded-0 border-0" type="text" name="q" placeholder="Search repos" aria-label="Search"></form>
                  <div class="navbar-nav flex-row">
                    <div class="nav-item text-nowrap">
                      <a class="nav-link px-3 active" href="/cgi-bin/repo?id=zKY9ib1JHc49jRLKbwGarENq1PVA">rustpilled-bot</a>
                    </div>
                  </div>
                </header>
                <div class="container-fluid">
                  <div class="row">
                    <nav id="sidebarMenu" class="col-md-3 col-lg-2 d-md-block bg-dark sidebar collapse">
                      <div class="position-sticky pt-3 sidebar-sticky">
                        <ul class="nav flex-column">
                          <li class="nav-item">
                            <a class="nav-link active" href="/cgi-bin/repo?id=zKY9ib1JHc49jRLKbwGarENq1PVA">
                              <i class="align-text-bottom fa-solid fa-info"></i>
                              Info
                            </a>
                          </li>
                          <li class="nav-item">
                            <a class="nav-link" href="/cgi-bin/repo?id=zKY9ib1JHc49jRLKbwGarENq1PVA&issue=list">
                              <i class="align-text-bottom fa-solid fa-layer-group"></i>
                              Issues
                            </a>
                          </li>
                          <li class="nav-item">
                            <a class="nav-link" href="/cgi-bin/repo?id=zKY9ib1JHc49jRLKbwGarENq1PVA&patch=list">
                              <i class="align-text-bottom fa-solid fa-vest-patches"></i>
                              Patches
                            </a>
                          </li>
                          <li class="nav-item">
                            <a class="nav-link" href="/cgi-bin/repo?id=zKY9ib1JHc49jRLKbwGarENq1PVA&wallet=list">
                              <i class="align-text-bottom fa-solid fa-wallet"></i>
                              Wallets
                            </a>
                          </li>
                          <li class="nav-item">
                            <a class="nav-link" href="/cgi-bin/repo?id=zKY9ib1JHc49jRLKbwGarENq1PVA&source=.">
                              <i class="align-text-bottom fa-solid fa-code"></i>
                              Source
                            </a>
                          </li>
                        <h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted text-uppercase">
                          <span></span>
                        </h6>
                        <ul class="nav flex-column mb-2">
                        
                        </ul>
                      </div>
                    </nav>
                <main class="col-md-9 ms-sm-auto col-lg-10">
                  <div class="container px-1 py-3">
        

    <div class="list-group">
    <div class="list-group-item">
    <div style="font-size:1.3rem;">rustpilled-bot</div>
    <div class="repo-item">ilotterytea&#x27;s twitch bot</div>
    <div>rad:zKY9ib1JHc49jRLKbwGarENq1PVA</div>
    </div>
    <div class="list-group-item">
    <div>Visibility</div>
    <div class="repo-item">public</div>
    </div>
    <div class="list-group-item">
    <div>Delegates</div><div class="repo-item">did:key:z6Mki3QJhFXqH7msB43Coozzy1PjLqso5H2VaswLMqeerYMk</div>
    </div>
    <div class="list-group-item">
    <div>Default branch</div>
    <div><span class="repo-item">master &#8594 15a52bffee565a0de19a1c0473539bd0e3b8d9db</span> (Wed Apr  9 23:39:22 2025)</div>
    </div>
    <div class="list-group-item">
    <div>Threshold</div>
    <div class="repo-item">1</div>
    </div>
    </div>
    
        <div class="list-group mt-3">
        <div class="list-group-item">
        <div class="mb-2" style="font-weight:bold;"><i class="fa-solid fa-book"></i> README.md</div>
        <pre style="margin:0; font-size:0.85rem; overflow-x:auto; color:#fafafa;"># ilotterytea&#x27;s rustpilled bot

A utility and entertainment multi-chat Twitch bot.

## Features

+ Listening to the stream start/end and notifying chatters.
+ Sending messages in intervals *(like timers)*
+ PostgreSQL database support
+ Ping all chatters with a message *(massping)*
+ Running user-created Lua scripts
+ Counting emote usage. [More...](#more-about-emote-usage-counting)

## Prerequisites

+ Rust compiler
+ PostgreSQL
+ Diesel CLI `(cargo install diesel_cli --no-default-features -F postgres)`

## Installation guide

1. Install all prerequisites.
2. Clone the repository from the desired source and open it in the terminal.
3. [Create a configuration file *(rustpilled_bot.toml)*](#rustpilled_bottoml-example-with-all-available-parameters)
4. Applying database migration: `diesel migration run --database-url &quot;postgres://user:pass@host/name&quot;`

5. Run the bot

+ Twitch bot: `cargo run --release --package bot`
+ API: `cargo run --release --package api`

### rustpilled_bot.toml example with all available variables

```toml
[database]
url = &quot;postgres://user:pass@host/name&quot;

[bot]
username = &quot;YYYYYY&quot;
password = &quot;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&quot;
owner_twitch_id = 123456789 # optional, can be used by some commands to access superuser subcommands.
client_id = &quot;ABCDEF&quot; # optional, used by web auth.
client_secret = &quot;FEDCBA&quot;  # optional, used by web auth.
redirect_uri = &quot;ACEBDF&quot;  # optional, used by web auth.

[web]
port = 8080 # optional
contact_name = &quot;forsen&quot; # optional
contact_url = &quot;https://twitch.tv/forsen&quot; # optional
bot_title = &quot;forsen&#x27;s twitch bot&quot; # optional

[commands]
default_prefix = &quot;!&quot; # optional
default_language = &quot;english&quot; # optional

[commands.spam]
max_count = 50 # optional, maximum number of lines that !spam can send at a time

[third_party]
docs_url = &quot;https://forsen.tv/wiki&quot; # optional, this is base url for command reference
stats_api_url = &quot;https://stats.forsen.tv&quot; # optional
stats_api_password = &quot;TZULQS&quot; # optional, required if you want to join your channels there.
pastea_api_url = &quot;https://paste.forsen.tv&quot; # optional
pastea_api_password = &quot;ASDASD&quot; # optional, can be used by !chatters to post authorized pastes, otherwise they will be “posted by anonymous”.
```

&gt; You must generate an OAuth2 password from [TwitchTokenGenerator with special scopes](https://twitchtokengenerator.com/quick/riIPG7o2Fd) for bot, because this password is used not only for chat communication, but also for commands that use Twitch API endpoints that can only be accessed with special permissions *(for example, !massping requires moderator:read:chatters)*.

### More about emote usage counting

You can use [standard instance of &quot;ilotterytea/stats&quot;](https://stats.ilotterytea.kz), but you will only be able to get statistics from channels that [teabot] has joined. If you want to join your own channels, you need to [deploy your own instance of &quot;ilotterytea/stats&quot;](https://github.com/ilotterytea/stats) and set the `stats_api_url` and `stats_api_password` variables in the `rustpilled_bot.toml` file.</pre>
        </div>
        </div>

</div>
</main>
</div>
</div>


</body>
</html>

