Projects About Donate GitHub
Back to the bench

Two plugins for ArchiSteamFarm, both shipping. Open source under Apache-2.0.

ASF Plugins

Plugins for ArchiSteamFarm. Each one drops into ASF's plugins directory, keeps its settings in ASF's own config files, and works in ASF's Docker image.

What they share

ArchiSteamFarm plugins

Each is installed by extracting its release zip into plugins/<Name>/, and ASF's plugin updater can keep it current. ASF-Notifier is built and tested against ArchiSteamFarm 6.3.10.6, with the .NET runtime ASF ships with; ASF-PluginConfig needs ASF 6.3.11.7 or later, with IPC enabled.

Shipping, 1.1.2.0. Open source under Apache-2.0.

ASF-Notifier

Hear about it when a bot stops. An ArchiSteamFarm plugin that posts to a Matrix room when a bot is stopped, loses its connection and comes back, finishes farming, or ASF is updated.

What the room looks like

  • ๐Ÿ”ด bot1 โ€” login failed (TwoFactorCodeMismatch), ASF stopped the bot
  • ๐ŸŸ  bot1 โ€” disconnected for 5 minutes (NoConnection)
  • ๐ŸŸข bot1 โ€” reconnected after 12 minutes
  • โœ… bot2 โ€” farming finished

Example messages. Each bot message names the bot, so one room serves every bot.

What it is

A plugin, not a service

If you run ArchiSteamFarm and want to know when something needs you, this puts it in a chat room. It sends a message when ASF stops a bot, when a bot stays disconnected and when it logs on again, when farming finishes and when ASF is updated.

One plugin and one room serve every bot in the instance, including bots you add later. Delivery runs on a background queue, so a slow homeserver never slows ASF down, and the access token is never logged.

Events

Each one is on or off, globally and per bot, except AsfUpdated, which is global
BotStoppedByAsfASF stopped the bot: login failed, or it needs input. On.
BotDisconnectedStill disconnected after a set time, 5 minutes by default. On.
BotReconnectedLogged on again after a disconnect was reported. On.
FarmingFinishedFarming finished and something was farmed. On.
AsfUpdatedASF is newer than at the last start. On.
BotStoppedA bot stopped without an ASF error, for example the stop command. Off.
FarmingStartedFarming started. Off.
FarmingStoppedFarming stopped. Off.

Global and per bot

ASF's own config files

The settings live in an ASFNotifier block in ASF.json. A bot can have its own block in its config file to silence it or to change which events it reports. A per-bot value wins over the global one, and ASF applies an edit when the bot config reloads, with no restart.

{ "ASFNotifier": {
    "Events": { "FarmingFinished": false }
} }

The room is global: there is no per-bot room.

Quick start

From the release zip
  1. Download ASFNotifier.zip from the latest release and extract its contents into plugins/ASFNotifier/. With Docker, that is the mounted plugins directory.
  2. On your Matrix homeserver, create a bot user and an unencrypted room, invite the bot and join it. Note its access token and the room ID.
  3. Add the room to ASF.json:
{
  "ASFNotifier": {
    "Matrix": {
      "HomeserverUrl": "https://matrix.example.org",
      "RoomId": "!abc123:example.org"
    }
  }
}
  1. Put the token in the environment of the ASF process, not in ASF.json: ASF_NOTIFIER_MATRIX_ACCESS_TOKEN.
  2. Restart ASF, then send !notifytest to a bot as its Master or Owner. A test message appears in the room.

Requirements

Matrix only, unencrypted rooms only

Built and tested against ArchiSteamFarm 6.3.10.6. The .NET runtime is the one ASF ships with, so there is nothing else to install. You need a Matrix homeserver, a dedicated bot user and an unencrypted room, addressed by its room ID rather than an alias.

Telegram, Discord and the rest

Through Matrix

The plugin speaks Matrix only. To get the same alerts elsewhere, bridge the alerts room to the other network, for example with the mautrix bridges for Telegram, Discord, WhatsApp, Signal and Slack, or just read the room in any Matrix client with push notifications on.

Bridges are not tested by this project: the plugin only ever posts to the room.

Updates

Through ASF's plugin updater

Add ASFNotifier to PluginsUpdateList in ASF.json and ASF fetches new releases from GitHub by itself, in Docker too. It is opt-in: by default no plugin is updated. The README says how to turn it off, update by hand or stay on one version. After an update ASF restarts itself, or exits in Docker, so the container needs a restart policy.

Quiet by design

Little noise

Stop messages wait about ten seconds, so an ASF restart does not look like every bot stopping. The same event for the same bot is sent at most once every ten minutes, and at most twenty go out in an hour, apart from stops by ASF and reconnects. A short outage that ends before the threshold sends nothing.

Open and free โ€” support it

Apache-2.0

Free and open source. If it saved you a night of wondering why nothing was farming, a donation is much appreciated.

Donate GitHub Sponsors

Shipping, 1.0.0.0. Open source under Apache-2.0.

ASF-PluginConfig

One page to edit the settings of the other installed plugins. A plugin that embeds a JSON Schema gets a form; one without gets a raw JSON editor for its key.

The page, listing one plugin with its global and bot settings, this plugin's own settings, the raw JSON card and the update button
One card per plugin with a schema, a raw JSON card for the rest, and the button that asks ASF to update plugins.

What it is

A host for other plugins' settings

Most ASF plugins keep their settings as an extra key in ASF.json or a bot's config file, and ASF-ui does not show those keys. This plugin serves a page with a form for each plugin that embeds a schema, for its global settings and for each bot's, and a button that asks ASF to update plugins.

Saving

Only that plugin's key

Input is checked against the schema before anything is written, and a save replaces only that plugin's key. ASF reloads on its own: a global change restarts ASF, a per-bot change restarts that bot.

Saving needs IPCPassword set, unless you opt out, a save is rejected if the file changed since the form was loaded, and secrets stay on the server: a secret field is never sent to the page.

For plugin authors

One embedded file

A plugin opts in by embedding <AssemblyName>.config.schema.json, with no shared assembly to reference, and keeps reading its config as before. A plugin without one is edited as raw JSON.

Getting it

From the release zip

It needs ASF 6.3.11.7 or later, with IPC enabled. Download the release zip, unzip it into plugins/ASFPluginConfig/, restart ASF and open /plugin-config/ on ASF's IPC address. The steps are in its README.