Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation needed: Update custom triggers documentation #119

Open
Whipstickgostop opened this issue Mar 8, 2024 · 1 comment
Open
Labels
documentation Improvements or additions to documentation

Comments

@Whipstickgostop
Copy link
Member

Whipstickgostop commented Mar 8, 2024

Describe the missing documentation
Add additional context for registering custom triggers within Init()

Where do you think this documentation should be included? An existing page or new page?
https://docs.streamer.bot/guide/triggers#custom-triggers

Additional context
From @Rhondi Discord Post

When registering custom triggers, it's best practice to register them in the public void Init() method. And also adjust the Execute C# Code sub-action to Precompile on Application Start

image

public void Init()
{
    CPH.RegisterCustomTrigger("New Twitch Clip Found", "clip_found", new[] {"Twitch"});
}

image

@Whipstickgostop Whipstickgostop added the documentation Improvements or additions to documentation label Mar 8, 2024
@rondhi
Copy link
Contributor

rondhi commented Mar 8, 2024

image

You can even nest deeper categories this way

public void Init()
{
    CPH.RegisterCustomTrigger("Poll Ended", "poll_ended", new[] {"Chat Based Poll"});
    CPH.RegisterCustomTrigger("Poll Canceled", "poll_canceled", new[] {"Chat Based Poll"});
    CPH.RegisterCustomTrigger("Poll Status", "poll_status", new[] {"Chat Based Poll"});
    CPH.RegisterCustomTrigger("Poll Message Winner", "poll_winner_one", new[] {"Chat Based Poll", "Winner"});
    CPH.RegisterCustomTrigger("Poll Message Tie 2", "poll_winner_two", new[] {"Chat Based Poll", "Winner"});
    CPH.RegisterCustomTrigger("Poll Message Tie 3", "poll_winner_three", new[] {"Chat Based Poll", "Winner"});
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants