Self-hosted alternative to one of the big bots managed by big companies…
Find a file
Knut Ahlers 20356abe23
[core] Allow to pass ID to channel modification
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2022-10-01 15:06:32 +02:00
.github [docs] Update README and funding 2021-10-22 21:37:48 +02:00
ci [editor] Rework to use esbuild / Vue component files (#12) 2021-12-06 17:25:19 +01:00
docs Allow to customize token 2021-04-04 20:26:32 +02:00
editor [editor] Rework to use esbuild / Vue component files (#12) 2021-12-06 17:25:19 +01:00
examples/plugin [lint] Properly format inputs 2021-11-25 23:48:16 +01:00
internal [core] Allow to pass ID to channel modification 2022-10-01 15:06:32 +02:00
pkg [core] Allow to pass ID to channel modification 2022-10-01 15:06:32 +02:00
plugins [core] Move storage to SQLite database (#30) 2022-09-10 13:39:07 +02:00
src [editor] Add explanatory hint for exceptions 2022-06-20 19:02:00 +02:00
wiki [templating] Add jsonAPI template function 2022-09-26 23:32:48 +02:00
.dockerignore [editor] Rework to use esbuild / Vue component files (#12) 2021-12-06 17:25:19 +01:00
.eslintrc.js [editor] Rework to use esbuild / Vue component files (#12) 2021-12-06 17:25:19 +01:00
.gitignore [core] Move storage to SQLite database (#30) 2022-09-10 13:39:07 +02:00
.golangci.yml Lint: Remove deprecated linters 2022-09-06 00:11:52 +02:00
.repo-runner.yaml CI: Fix missing tooling in CI image 2022-09-06 00:06:41 +02:00
action_script.go [core] Move storage to SQLite database (#30) 2022-09-10 13:39:07 +02:00
actions.go [core] Move storage to SQLite database (#30) 2022-09-10 13:39:07 +02:00
actorDocs.go [lint] Properly format inputs 2021-11-25 23:48:16 +01:00
actorDocs.tpl [quotedb] Add new actor 2021-10-19 00:22:05 +02:00
auth.go [core] Move storage to SQLite database (#30) 2022-09-10 13:39:07 +02:00
automessage.go [automessage] Add disable switch 2021-12-18 19:22:18 +01:00
botEditor.go [core] Move storage to SQLite database (#30) 2022-09-10 13:39:07 +02:00
botUserState.go [core] Move storage to SQLite database (#30) 2022-09-10 13:39:07 +02:00
config.go [core] Move storage to SQLite database (#30) 2022-09-10 13:39:07 +02:00
configEditor.go [core] Move storage to SQLite database (#30) 2022-09-10 13:39:07 +02:00
configEditor_automessage.go [lint] Properly format inputs 2021-11-25 23:48:16 +01:00
configEditor_dev.go [editor] Rework to use esbuild / Vue component files (#12) 2021-12-06 17:25:19 +01:00
configEditor_general.go [core] Move storage to SQLite database (#30) 2022-09-10 13:39:07 +02:00
configEditor_global.go [editor] Fix: Upgrade contains a header send, error must not send headers 2022-02-10 00:30:40 +01:00
configEditor_prod.go [editor] Rework to use esbuild / Vue component files (#12) 2021-12-06 17:25:19 +01:00
configEditor_rules.go [lint] Properly format inputs 2021-11-25 23:48:16 +01:00
configwatch.go Fix: Do not spam events when file is gone for longer 2021-05-24 18:00:50 +02:00
cors.go [core] Fix: Allow PATCH method in CORS 2022-03-29 00:56:10 +02:00
default_config.yaml Breaking: Add configuration interface and switch to more generic config format (#7) 2021-09-22 15:36:45 +02:00
Dockerfile [editor] Update nodejs build version and deps 2022-02-26 17:26:02 +01:00
events.go [core] Add support for "annoumcement" event type 2022-04-01 02:02:14 +02:00
fields.go Expose user_id in events 2022-06-17 22:13:47 +02:00
functions.go [core] Move storage to SQLite database (#30) 2022-09-10 13:39:07 +02:00
functions_irc.go [lint] Properly format inputs 2021-11-25 23:48:16 +01:00
functions_twitch.go [core] add streamUptime / formatDuration template functions 2021-10-13 14:30:45 +02:00
git.go [core] Allow the bot to track config editor changes through Git 2021-10-22 17:09:39 +02:00
go.mod [templating] Add jsonAPI template function 2022-09-26 23:32:48 +02:00
go.sum [templating] Add jsonAPI template function 2022-09-26 23:32:48 +02:00
helpers.go [core] Move storage to SQLite database (#30) 2022-09-10 13:39:07 +02:00
History.md prepare release v2.7.1 2022-09-06 00:52:23 +02:00
irc.go [core] Move storage to SQLite database (#30) 2022-09-10 13:39:07 +02:00
LICENSE Add META 2020-12-21 01:55:48 +01:00
main.go [core] Move storage to SQLite database (#30) 2022-09-10 13:39:07 +02:00
Makefile [wiki] Update actor documentation 2022-02-10 02:02:25 +01:00
msgformatter.go [msgformatter] Fix: Trim leading / trailing spaces 2022-07-16 21:45:14 +02:00
package-lock.json [editor] Update nodejs build version and deps 2022-02-26 17:26:02 +01:00
package.json [ci] Ensure build dependencies are available for prod builds 2022-01-20 02:20:22 +01:00
plugins.go [lint] Properly format inputs 2021-11-25 23:48:16 +01:00
plugins_core.go [templating] Add jsonAPI template function 2022-09-26 23:32:48 +02:00
plugins_unsupported.go Add plugin support to allow extending of functionality (#6) 2021-08-19 15:33:56 +02:00
README.md [core] Move storage to SQLite database (#30) 2022-09-10 13:39:07 +02:00
scopes.go [core] Move storage to SQLite database (#30) 2022-09-10 13:39:07 +02:00
status.go [status] Fix: Add missing API docs 2022-03-31 00:29:27 +02:00
swagger.go [lint] Properly format inputs 2021-11-25 23:48:16 +01:00
swagger.html [openapi] Allow subdir serving 2021-10-10 01:40:44 +02:00
twitchWatcher.go [core] Move storage to SQLite database (#30) 2022-09-10 13:39:07 +02:00
writeAuth.go [overlays] Add overlays server capability (#14) 2022-02-08 19:58:19 +01:00
wrNoOpCloser.go Add raw-log functionality 2021-04-09 18:14:44 +02:00

Go Report Card

Luzifer / twitch-bot

Twitch-Bot is intended as an alternative to having a bot managed by Streamlabs or Streamelements and therefore having more control over it, the availability and how it works.

At the moment it is a work-in-progress and does not yet implment all features it shall in the future.

Configuration

Please see the Wiki for documentation of the configuration file.

# twitch-bot --help
Usage of twitch-bot:
      --base-url string                  External URL of the config-editor interface (set to enable EventSub support)
      --command-timeout duration         Timeout for command execution (default 30s)
  -c, --config string                    Location of configuration file (default "./config.yaml")
      --log-level string                 Log level (debug, info, warn, error, fatal) (default "info")
      --plugin-dir string                Where to find and load plugins (default "/usr/lib/twitch-bot")
      --rate-limit duration              How often to send a message (default: 20/30s=1500ms, if your bot is mod everywhere: 100/30s=300ms, different for known/verified bots) (default 1.5s)
      --storage-database string          Database file to store data in (default "./storage.db")
      --storage-encryption-pass string   Passphrase to encrypt secrets inside storage (defaults to twitch-client:twitch-client-secret)
      --twitch-client string             Client ID to act as
      --twitch-client-secret string      Secret for the Client ID
      --twitch-token string              OAuth token valid for client (fallback if no token was set in interface)
  -v, --validate-config                  Loads the config, logs any errors and quits with status 0 on success
      --version                          Prints current version and exits

# twitch-bot help
Supported sub-commands are:
  actor-docs                     Generate markdown documentation for available actors
  api-token <name> <scope...>    Generate an api-token to be entered into the config
  migrate-v2 <old file>          Migrate old (*.json.gz) storage file into new database
  help                           Prints this help message

Upgrade from v2.x to v3.x

With the release of v3.0.0 the bot changed a lot introducing a new storage format. As that storage backend is not compatible with the v2.x storage you need to migrate it manually before starting a v3.x bot version the first time.

Before starting the migration make sure to fully stop the bot!

This section assumes you were starting your bot the following way:

# twitch-bot --storage-file storage.json.gz --twitch-client <clientid> --twitch-client-secret <secret>

To execute the migration we need to provide the same storage-encryption-pass or twitch-client / twitch-client-secret combination if no storage-encryption-pass was used.

# twitch-bot --storage-database storage.db --twitch-client <clientid> --twitch-client-secret <secret> migrate-v2 storage.json.gz
WARN[0000] No storage encryption passphrase was set, falling back to client-id:client-secret
WARN[0000] Module registered unhandled query-param type  module=status type=integer
WARN[0000] Overlays dir not specified, no dir or non existent  dir=
INFO[0000] Starting migration...                         module=variables
INFO[0000] Starting migration...                         module=mod_punish
INFO[0000] Starting migration...                         module=mod_overlays
INFO[0000] Starting migration...                         module=mod_quotedb
INFO[0000] Starting migration...                         module=core
INFO[0000] Starting migration...                         module=counter
INFO[0000] Starting migration...                         module=permissions
INFO[0000] Starting migration...                         module=timers
INFO[0000] v2 storage file was migrated

If you see the v2 storage file was migrated message the contents of your old storage file were migrated to the new storage-database. The old file is not modified in this step.

Afterwards your need to adjust the start parameters of the bot:

# twitch-bot --storage-database storage.db --twitch-client <clientid> --twitch-client-secret <secret>