Skip to content
ForgeCastDocs

Money, events, goals, channel

Amounts in the streamer's currency, the app's events, goals shared with overlays, and the channel's videos and schedule.

Functions

money.currency()

The streamer's currency ("INR", "USD"…).

Returns string

money.convert(value, from, to)

An amount in another currency (the streamer's by default), from today's rates; nil when a currency isn't known.

Name

Type

Returns number?

money.format(value, currency)

An amount the way people write it: "₹1,23,456.00", "$5.00", "12.00 SEK" (the streamer's currency by default).

  • value: number
  • currency: string, optional

Returns string

events.recent(n)

The app's latest events (what Recent events shows), newest first.

  • n: integer, optional. 20 by default

Returns AppEvent[]

events.on(event, handler)

Hear an event type ("superchat", "member.new", "subscriber.new"…, or "any"). "flow.<name>" hears a chat action's "Tell plugins" block: the event is { name, text, user = { id, name }, message, args, rule }.

  • event: string
  • handler: fun(e: AppEvent)

Returns integer id

events.off(id)

Stop a handler made with events.on.

  • id: integer

Returns boolean found

goals.list()

Every goal the overlays can show ({{goal.<name>.current}}…).

Returns Goal[]

goals.get(name)

One goal, or nil.

  • name: string

Returns Goal?

goals.set(name, spec, callback)

Make or change a goal: { current, target, title }.

Name

Type

goals.add(name, amount, callback)

Add to a goal's progress (a Super Chat, a tip from outside YouTube…).

Name

Type

goals.on(event, handler)

Hear Event.GoalChange (goals.on("change", fn)).

  • event: string
  • handler: fun(goal: Goal)

Returns integer id

goals.off(id)

Stop a handler made with goals.on.

  • id: integer

Returns boolean found

channel.info()

The channel: { id, name, handle, subscribers, avatar, banner }.

Returns table

channel.videos(n)

Its latest videos, newest first (5 by default).

  • n: integer, optional

Returns ChannelVideo[]

channel.upcoming()

Its scheduled streams: { { id, title, starts_at } }.

Returns table[]

Types

Open a type to see its fields; type names above link here.

On this page