How to subscribe to TriggeredEvent?

It returns error This function parameter expects a value of type ?agent->void, but this argument is an incompatible value of type type{_(:[]char)<suspends>:void}.

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }

# See https://dev.epicgames.com/documentation/en-us/uefn/create-your-own-device-in-verse for how to create a verse device.

# A Verse-authored creative device that can be placed in a level
MapLoader := class(creative_device):

    @editable
    CC:trigger_device = trigger_device{}

    @editable
    MapText:billboard_device = billboard_device{}

    @editable
    DifficultyText:billboard_device = billboard_device{}

    var initseconds : int = 0

    @editable
    StartTimer:billboard_device = billboard_device{}

    @editable
    RNG:rng_device = rng_device{}

    @editable
    InitTimerInit:trigger_device = trigger_device{}

    StringToMessage<localizes>(value:string)<computes> : message = "{value}"

    OnBegin<override>()<suspends>:void=
        Print("Script started")

        MapText.SetText(StringToMessage("Waiting for player(s).."))
        DifficultyText.SetText(StringToMessage(" "))
        StartTimer.SetText(StringToMessage("{initseconds}s"))
        Print("Defaults set")
        

        InitTimerInit.TriggeredEvent.Await()
        Print("I saw a TriggeredEvent")
        set initseconds = 10
        Print("initseconds set")
        loop:
            if (initseconds > 0):
                set initseconds = initseconds - 1
                Sleep(1.0)
                StartTimer.SetText(StringToMessage("{initseconds}s"))
                Print("{initseconds}")
            else:
                StartTimer.SetText(StringToMessage("{initseconds}s"))
                Print("Done")
                RNG.Activate()
                CC.TriggeredEvent.Subscribe(OnTriggeredEvent)
                break

OnTriggeredEvent<private>(Reading : string)<suspends>:void=
    MapText.SetText(StringToMessage("Castaway Castles"))
    DifficultyText.SetText(StringToMessage("EASY"))

CC.TriggeredEvent.Subscribe(myFunction)

this will send the agent which triggered cc to MyFunction

The error describes the problem. The handler function signature must match what the event expects. Like so:

OnTriggeredEvent<private>(Agent: ?agent):void=

(Note that <private> is only allowed inside a class - watch indents.)
If you want to pass extra data to the handler, you can use a wrapper (similar code is available in the snippets section.)

(Listenable : listenable(?agent)).SubscribeAgentVoid(Out : tuple(?agent, t)->void, MyData : t where t:type) : cancelable =
  Wrapper := wrapper_agentvoid(t){MyData := MyData, Out := Out}
  Listenable.Subscribe(Wrapper.In)

wrapper_agentvoid(t : type) := class():
  MyData : t;
  Out : tuple(?agent, t) -> void
  In(Agent : ?agent):void = Out(Agent, MyData)

Which you could then use like this:

TriggerCancelable : cancelable = Trigger.TriggeredEvent.SubscribeAgentVoid(OnTriggeredEvent, "Your String")

Or check this out:

Guide to Event Subscribing with Additional Parameters (Handler Functions) - Programming & Scripting / Verse - Epic Developer Community Forums (unrealengine.com)