🥳Events

Events fired by the WrangleBot engine.

WrangleBot will fire events during run time. You can create Hooks to listen to these events and then act on the supplied data.

event-idtriggered whendata

notification

system notifications

Object : {

title: string,

message: string

}

ready

WrangleBot booted

WrangleBot

error

system panic

Error

metalibrary-new

a new MetaLibrary was added

MetaLibrary

metalibrary-edit

a MetaLibrary was edited

MetaLibrary

metalibrary-remove

a MetaLibrary was deleted

string

metafile-new

a new MetaFile was added

MetaFile

metafile-remove

a MetaFile was deleted

string

metafile-edit

a MetaFile was edited

MetaFile

metafile-metadata-edit

metadata was edited

Object : { id: string, key: string, value: string }

metacopy-new

a new MetaCopy was added

MetaCopy

metacopy-remove

a MetaCopy was deleted

string

copytask-new

a CopyTask was added

CopyTask

copytask-edit

a CopyTask was modified

CopyTask

copytask-remove

a CopyTask was deleted

string

transcode-new

a TranscodeTask was added

TranscodeTask

transcode-edit

a TranscodeTask was modified

TranscodeTask

transcode-remove

a TranscodeTask was deleted

string

thumbnail-new

a new batch of thumbnails was extracted from a metafile

Thumbnail[]

Custom Events

You can trigger custom events in Hooks or Endpoints.

wranglebot.emit("my-custom-event-id", {
    foo: "bar"
})

In order to listen to your custom Event, you must add it to your Hooks events array.

module.exports = {
  name: "example-custom-event",
  description: "An example hook of a custom event",
  version: "0.0.1",
  events: ["my-custom-event-id"],
  handler: async (event, data, wranglebot) => {
    console.log(data.foo) // prints "bar"
  },
};

Last updated