endstone-chat-triggers 1.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. endstone_chat_triggers-1.0.1/.github/workflows/main.yml +29 -0
  2. endstone_chat_triggers-1.0.1/.github/workflows/python-publish.yml +70 -0
  3. endstone_chat_triggers-1.0.1/.gitignore +7 -0
  4. endstone_chat_triggers-1.0.1/LICENSE +24 -0
  5. endstone_chat_triggers-1.0.1/PKG-INFO +108 -0
  6. endstone_chat_triggers-1.0.1/README.md +92 -0
  7. endstone_chat_triggers-1.0.1/docs/assets/ctfavi.png.kra +0 -0
  8. endstone_chat_triggers-1.0.1/docs/assets/images/chattriggers.png +0 -0
  9. endstone_chat_triggers-1.0.1/docs/assets/images/favicon.png +0 -0
  10. endstone_chat_triggers-1.0.1/docs/assets/images/screenshot-logging.png +0 -0
  11. endstone_chat_triggers-1.0.1/docs/fonts/Xanh_Mono/OFL.txt +93 -0
  12. endstone_chat_triggers-1.0.1/docs/fonts/Xanh_Mono/XanhMono-Italic.ttf +0 -0
  13. endstone_chat_triggers-1.0.1/docs/fonts/Xanh_Mono/XanhMono-Regular.ttf +0 -0
  14. endstone_chat_triggers-1.0.1/docs/fonts/Xanh_Mono/xanh-mono-v19-latin-italic.woff2 +0 -0
  15. endstone_chat_triggers-1.0.1/docs/fonts/Xanh_Mono/xanh-mono-v19-latin-regular.woff2 +0 -0
  16. endstone_chat_triggers-1.0.1/docs/getting-started/installation.md +0 -0
  17. endstone_chat_triggers-1.0.1/docs/index.md +147 -0
  18. endstone_chat_triggers-1.0.1/docs/javascripts/headers.js +139 -0
  19. endstone_chat_triggers-1.0.1/docs/javascripts/window.js +47 -0
  20. endstone_chat_triggers-1.0.1/docs/requirements.txt +3 -0
  21. endstone_chat_triggers-1.0.1/docs/stylesheets/extra.css +287 -0
  22. endstone_chat_triggers-1.0.1/images/chattriggers.kra +0 -0
  23. endstone_chat_triggers-1.0.1/images/chattriggers.png +0 -0
  24. endstone_chat_triggers-1.0.1/images/twitchspawnforendstone.png +0 -0
  25. endstone_chat_triggers-1.0.1/images/twitchspawnforendstone.png.kra +0 -0
  26. endstone_chat_triggers-1.0.1/properdocs.yml +35 -0
  27. endstone_chat_triggers-1.0.1/pyproject.toml +28 -0
  28. endstone_chat_triggers-1.0.1/src/endstone_chat_triggers/__init__.py +28 -0
  29. endstone_chat_triggers-1.0.1/src/endstone_chat_triggers/actions/__init__.py +13 -0
  30. endstone_chat_triggers-1.0.1/src/endstone_chat_triggers/actions/executor.py +185 -0
  31. endstone_chat_triggers-1.0.1/src/endstone_chat_triggers/actions/management.py +68 -0
  32. endstone_chat_triggers-1.0.1/src/endstone_chat_triggers/actions/models.py +68 -0
  33. endstone_chat_triggers-1.0.1/src/endstone_chat_triggers/actions/parser/__init__.py +8 -0
  34. endstone_chat_triggers-1.0.1/src/endstone_chat_triggers/actions/parser/linter.py +328 -0
  35. endstone_chat_triggers-1.0.1/src/endstone_chat_triggers/actions/parser/parser.py +75 -0
  36. endstone_chat_triggers-1.0.1/src/endstone_chat_triggers/actions/parser/reporting.py +165 -0
  37. endstone_chat_triggers-1.0.1/src/endstone_chat_triggers/api.py +16 -0
  38. endstone_chat_triggers-1.0.1/src/endstone_chat_triggers/commands.py +48 -0
  39. endstone_chat_triggers-1.0.1/src/endstone_chat_triggers/config.py +155 -0
  40. endstone_chat_triggers-1.0.1/src/endstone_chat_triggers/debug/__init__.py +3 -0
  41. endstone_chat_triggers-1.0.1/src/endstone_chat_triggers/debug/listener.py +35 -0
  42. endstone_chat_triggers-1.0.1/src/endstone_chat_triggers/events/__init__.py +6 -0
  43. endstone_chat_triggers-1.0.1/src/endstone_chat_triggers/events/base.py +86 -0
  44. endstone_chat_triggers-1.0.1/src/endstone_chat_triggers/events/streamlabs/__init__.py +63 -0
  45. endstone_chat_triggers-1.0.1/src/endstone_chat_triggers/events/streamlabs/client.py +59 -0
  46. endstone_chat_triggers-1.0.1/src/endstone_chat_triggers/events/streamlabs/events.py +112 -0
  47. endstone_chat_triggers-1.0.1/src/endstone_chat_triggers/events/streamlabs/models.py +318 -0
  48. endstone_chat_triggers-1.0.1/src/endstone_chat_triggers/events/twitchapi/__init__.py +35 -0
  49. endstone_chat_triggers-1.0.1/src/endstone_chat_triggers/events/twitchapi/client.py +291 -0
  50. endstone_chat_triggers-1.0.1/src/endstone_chat_triggers/events/twitchapi/events.py +68 -0
  51. endstone_chat_triggers-1.0.1/src/endstone_chat_triggers/events/twitchapi/models.py +53 -0
  52. endstone_chat_triggers-1.0.1/src/endstone_chat_triggers/main.py +177 -0
  53. endstone_chat_triggers-1.0.1/src/endstone_chat_triggers/py.typed +0 -0
@@ -0,0 +1,29 @@
1
+ name: Auto Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v[0-9]+.[0-9]+.*'
7
+
8
+ permissions:
9
+ contents: write
10
+
11
+ jobs:
12
+ release:
13
+ runs-on: ubuntu-latest
14
+
15
+ steps:
16
+ - uses: actions/checkout@v3
17
+
18
+ - run: python3 -m pip install --user pipx
19
+
20
+ - name: Build wheel
21
+ run: pipx run build --wheel
22
+
23
+ - name: Create GitHub Release
24
+ id: create_release
25
+ uses: softprops/action-gh-release@v1
26
+ with:
27
+ tag_name: ${{ github.ref_name }}
28
+ name: Release ${{ github.ref_name }}
29
+ files: dist/*.whl
@@ -0,0 +1,70 @@
1
+ # This workflow will upload a Python Package to PyPI when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3
+
4
+ # This workflow uses actions that are not certified by GitHub.
5
+ # They are provided by a third-party and are governed by
6
+ # separate terms of service, privacy policy, and support
7
+ # documentation.
8
+
9
+ name: Upload Python Package
10
+
11
+ on:
12
+ release:
13
+ types: [published]
14
+
15
+ permissions:
16
+ contents: read
17
+
18
+ jobs:
19
+ release-build:
20
+ runs-on: ubuntu-latest
21
+
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+
25
+ - uses: actions/setup-python@v5
26
+ with:
27
+ python-version: "3.x"
28
+
29
+ - name: Build release distributions
30
+ run: |
31
+ # NOTE: put your own distribution build steps here.
32
+ python -m pip install build
33
+ python -m build
34
+
35
+ - name: Upload distributions
36
+ uses: actions/upload-artifact@v4
37
+ with:
38
+ name: release-dists
39
+ path: dist/
40
+
41
+ pypi-publish:
42
+ runs-on: ubuntu-latest
43
+ needs:
44
+ - release-build
45
+ permissions:
46
+ # IMPORTANT: this permission is mandatory for trusted publishing
47
+ id-token: write
48
+
49
+ # Dedicated environments with protections for publishing are strongly recommended.
50
+ # For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
51
+ environment:
52
+ name: pypi
53
+ # OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
54
+ # url: https://pypi.org/p/YOURPROJECT
55
+ #
56
+ # ALTERNATIVE: if your GitHub Release name is the PyPI project version string
57
+ # ALTERNATIVE: exactly, uncomment the following line instead:
58
+ # url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}
59
+
60
+ steps:
61
+ - name: Retrieve release distributions
62
+ uses: actions/download-artifact@v4
63
+ with:
64
+ name: release-dists
65
+ path: dist/
66
+
67
+ - name: Publish release distributions to PyPI
68
+ uses: pypa/gh-action-pypi-publish@release/v1
69
+ with:
70
+ packages-dir: dist/
@@ -0,0 +1,7 @@
1
+ .venv
2
+ .idea
3
+ **__pycache__/
4
+ bedrock_server
5
+ .devcontainer
6
+ dist/
7
+ .cache
@@ -0,0 +1,24 @@
1
+ This is free and unencumbered software released into the public domain.
2
+
3
+ Anyone is free to copy, modify, publish, use, compile, sell, or
4
+ distribute this software, either in source code form or as a compiled
5
+ binary, for any purpose, commercial or non-commercial, and by any
6
+ means.
7
+
8
+ In jurisdictions that recognize copyright laws, the author or authors
9
+ of this software dedicate any and all copyright interest in the
10
+ software to the public domain. We make this dedication for the benefit
11
+ of the public at large and to the detriment of our heirs and
12
+ successors. We intend this dedication to be an overt act of
13
+ relinquishment in perpetuity of all present and future rights to this
14
+ software under copyright law.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
23
+
24
+ For more information, please refer to <https://unlicense.org/>
@@ -0,0 +1,108 @@
1
+ Metadata-Version: 2.4
2
+ Name: endstone-chat-triggers
3
+ Version: 1.0.1
4
+ Summary: A plugin for streamers!! Handles live events and such
5
+ Author: MakiTazo
6
+ Author-email: niko-at-chalupa <nikolekrescendo@protonmail.com>
7
+ License-File: LICENSE
8
+ Requires-Dist: endstone
9
+ Requires-Dist: pydantic
10
+ Requires-Dist: python-socketio
11
+ Requires-Dist: rich
12
+ Requires-Dist: ruamel-yaml
13
+ Requires-Dist: twitchapi
14
+ Requires-Dist: websocket-client
15
+ Description-Content-Type: text/markdown
16
+
17
+ <div align="center">
18
+ <img src="images/chattriggers.png" alt="chat triggers" />
19
+ </div>
20
+
21
+ ---
22
+
23
+ > "A mod for twitch streamers. Handles live events with the rules handcrafted by the streamer!"
24
+
25
+ The full documentation can be found Documentation [here](https://niko-at-chalupa.github.io/endstone-chat-triggers/)
26
+
27
+ # Features
28
+
29
+ > <h3>
30
+ > - A lot of events!!
31
+ > </h3>
32
+ >
33
+ > The plugin's able to respond to a wide variety of events! Donations, follows, subscriptions, resubs, bits...
34
+
35
+ > <h3>
36
+ > - An easy way to bind to events
37
+ > </h3>
38
+ >
39
+ > Implements _workflows_, which are an easy way to have commands be ran upon an event.
40
+ > ```yaml
41
+ ># The name of the workflow. It can be anything.
42
+ >name: Give Chalupa7235 Diamonds on Follow
43
+ >
44
+ ># Events that trigger this workflow
45
+ >event:
46
+ > # You can have more workflows if you'd like, and
47
+ > # they'd all trigger this workflow.
48
+ > - TwitchFollowEvent
49
+ >
50
+ ># Commands that run before the workflow. If one of
51
+ ># these commands succeed or fail unexpectedly,
52
+ ># then it skips over the main steps. Optional.
53
+ >conditions:
54
+ > # You can add more, if you'd like. The format
55
+ > # is <command>: <succcess/fail>, wherein `false`
56
+ > # means you're expecting it to fail and `true`
57
+ > # means you're expecting it to succeed.
58
+ > - testfor Chalupa7235: true
59
+ >
60
+ ># If conditions succeed (or you don't have any),
61
+ ># then these commands here run.
62
+ >steps:
63
+ > - "give Chalupa7235 diamond 64"
64
+ > # ...you can add more if you'd like
65
+ >
66
+ ># If conditions fail, then the commands here run.
67
+ >fail_steps:
68
+ > - "say Chalupa7235 isn't in the server!"
69
+ > # ...you can add more if you'd like
70
+ > ```
71
+
72
+ > <h3>
73
+ > - A plugin API so external plugins can interact.
74
+ > </h3>
75
+ >
76
+ > Other plugins can interact with ChatTriggers, which means you're not limited to workflows.
77
+ > ```py
78
+ >from endstone_twitch_spawn import (
79
+ > get_chat_triggers_api,
80
+ > TwitchFollowEvent,
81
+ > streamlabs_event_handler,
82
+ > ChatTriggersApi
83
+ >)
84
+ >from endstone.plugin import Plugin
85
+ >
86
+ >class ExamplePlugin(Plugin):
87
+ > def on_enable(self):
88
+ > # This will get the plugin, and then the
89
+ > # plugin's API.
90
+ > api: ChatTriggersApi | None = get_chat_triggers_api(self.server.plugin_manager)
91
+ >
92
+ > # Since we're doing everything right, there
93
+ > # is little-to-no reason that this should
94
+ > # return None.
95
+ > assert api, "`get_chat_triggers_api` returned `None`"
96
+ > self.api: TwitchSpawnApi = api
97
+ >
98
+ > # Just like Endstone's register_events, you
99
+ > # can make a sperate listener class in a
100
+ > # different module to make >everything cleaner.
101
+ > self.api.register_events(self)
102
+ >
103
+ > @streamlabs_event_handler
104
+ > def on_twitch_follow(self, event: TwitchFollowEvent):
105
+ > # Simple test log so you can see that the
106
+ > # plugin's API is funcitonal.
107
+ > self.logger.info("Somebody followed!!")
108
+ > ```
@@ -0,0 +1,92 @@
1
+ <div align="center">
2
+ <img src="images/chattriggers.png" alt="chat triggers" />
3
+ </div>
4
+
5
+ ---
6
+
7
+ > "A mod for twitch streamers. Handles live events with the rules handcrafted by the streamer!"
8
+
9
+ The full documentation can be found Documentation [here](https://niko-at-chalupa.github.io/endstone-chat-triggers/)
10
+
11
+ # Features
12
+
13
+ > <h3>
14
+ > - A lot of events!!
15
+ > </h3>
16
+ >
17
+ > The plugin's able to respond to a wide variety of events! Donations, follows, subscriptions, resubs, bits...
18
+
19
+ > <h3>
20
+ > - An easy way to bind to events
21
+ > </h3>
22
+ >
23
+ > Implements _workflows_, which are an easy way to have commands be ran upon an event.
24
+ > ```yaml
25
+ ># The name of the workflow. It can be anything.
26
+ >name: Give Chalupa7235 Diamonds on Follow
27
+ >
28
+ ># Events that trigger this workflow
29
+ >event:
30
+ > # You can have more workflows if you'd like, and
31
+ > # they'd all trigger this workflow.
32
+ > - TwitchFollowEvent
33
+ >
34
+ ># Commands that run before the workflow. If one of
35
+ ># these commands succeed or fail unexpectedly,
36
+ ># then it skips over the main steps. Optional.
37
+ >conditions:
38
+ > # You can add more, if you'd like. The format
39
+ > # is <command>: <succcess/fail>, wherein `false`
40
+ > # means you're expecting it to fail and `true`
41
+ > # means you're expecting it to succeed.
42
+ > - testfor Chalupa7235: true
43
+ >
44
+ ># If conditions succeed (or you don't have any),
45
+ ># then these commands here run.
46
+ >steps:
47
+ > - "give Chalupa7235 diamond 64"
48
+ > # ...you can add more if you'd like
49
+ >
50
+ ># If conditions fail, then the commands here run.
51
+ >fail_steps:
52
+ > - "say Chalupa7235 isn't in the server!"
53
+ > # ...you can add more if you'd like
54
+ > ```
55
+
56
+ > <h3>
57
+ > - A plugin API so external plugins can interact.
58
+ > </h3>
59
+ >
60
+ > Other plugins can interact with ChatTriggers, which means you're not limited to workflows.
61
+ > ```py
62
+ >from endstone_twitch_spawn import (
63
+ > get_chat_triggers_api,
64
+ > TwitchFollowEvent,
65
+ > streamlabs_event_handler,
66
+ > ChatTriggersApi
67
+ >)
68
+ >from endstone.plugin import Plugin
69
+ >
70
+ >class ExamplePlugin(Plugin):
71
+ > def on_enable(self):
72
+ > # This will get the plugin, and then the
73
+ > # plugin's API.
74
+ > api: ChatTriggersApi | None = get_chat_triggers_api(self.server.plugin_manager)
75
+ >
76
+ > # Since we're doing everything right, there
77
+ > # is little-to-no reason that this should
78
+ > # return None.
79
+ > assert api, "`get_chat_triggers_api` returned `None`"
80
+ > self.api: TwitchSpawnApi = api
81
+ >
82
+ > # Just like Endstone's register_events, you
83
+ > # can make a sperate listener class in a
84
+ > # different module to make >everything cleaner.
85
+ > self.api.register_events(self)
86
+ >
87
+ > @streamlabs_event_handler
88
+ > def on_twitch_follow(self, event: TwitchFollowEvent):
89
+ > # Simple test log so you can see that the
90
+ > # plugin's API is funcitonal.
91
+ > self.logger.info("Somebody followed!!")
92
+ > ```
@@ -0,0 +1,93 @@
1
+ Copyright 2020 The XanhMono Project Authors (https://github.com/yellow-type-foundry/xanhmono).
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ https://openfontlicense.org
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,147 @@
1
+ ![chat triggers](assets/images/chattriggers.png)
2
+
3
+ <div class="animated-header-wrap">
4
+ <h2>ChatTriggers is an <a href="https://endstone.dev/stable/" target="blank">Endstone</a> plugin that <span class="highlight">integrates with your live streams and has things trigger based off of different events</span>.</h4>
5
+ </div>
6
+
7
+ ---
8
+
9
+ !!! quote "[TwitchSpawn](https://www.curseforge.com/minecraft/mc-mods/twitchspawn)"
10
+ "A mod for twitch streamers. Handles live events with the rules handcrafted by the streamer!"
11
+
12
+ ## Features
13
+ > <div class="animated-header-wrap">
14
+ > <h4>An <span class="highlight">easy way</span> to bind to events</h4>
15
+ > </div>
16
+ >
17
+ >
18
+ > Implements _workflows_, which are an easy way to have commands be ran upon an event.
19
+ >
20
+ > ```yaml
21
+ > # Small example of a basic workflow.
22
+ >
23
+ > # The name of the workflow. It can be anything.
24
+ > name: Give Chalupa7235 Diamonds on Follow
25
+ >
26
+ > # Events that trigger this workflow
27
+ > event:
28
+ > # You can have more workflows if you'd like, and
29
+ > # they'd all trigger this workflow.
30
+ > - TwitchFollowEvent
31
+ >
32
+ > # Commands that run before the workflow. If one of
33
+ > # these commands succeed or fail unexpectedly,
34
+ > # then it skips over the main steps. Optional.
35
+ > conditions:
36
+ > # You can add more, if you'd like. The format
37
+ > # is <command>: <succcess/fail>, wherein `false`
38
+ > # means you're expecting it to fail and `true`
39
+ > # means you're expecting it to succeed.
40
+ > - testfor Chalupa7235: true
41
+ >
42
+ > # If conditions succeed (or you don't have any),
43
+ > # then these commands here run.
44
+ > steps:
45
+ > - "give Chalupa7235 diamond 64"
46
+ > # ...you can add more if you'd like
47
+ >
48
+ > # If conditions fail, then the commands here run.
49
+ > fail_steps:
50
+ > - "say Chalupa7235 isn't in the server!"
51
+ > # ...you can add more if you'd like
52
+ > ```
53
+
54
+ <!-- -->
55
+
56
+ > <div class="animated-header-wrap">
57
+ > <h4>A <span class="highlight">lot</span> of events</h4>
58
+ > </div>
59
+ >
60
+ > The plugin's able to respond to a wide variety of events! Donations, follows, subscriptions, resubs, bits...
61
+
62
+ <!-- -->
63
+
64
+ > <div class="animated-header-wrap">
65
+ > <h4>A plugin API <span class="highlight">so other plugins can interact</span></h4>
66
+ > </div>
67
+ >
68
+ > Other plugins can interact with ChatTriggers, which means you're not limited to workflows.
69
+ >
70
+ > ```python
71
+ > from endstone_twitch_spawn import (
72
+ > get_chat_triggers_api,
73
+ > TwitchFollowEvent,
74
+ > streamlabs_event_handler,
75
+ > ChatTriggersApi
76
+ > )
77
+ > from endstone.plugin import Plugin
78
+ >
79
+ > class ExamplePlugin(Plugin):
80
+ > def on_enable(self):
81
+ > # This will get the plugin, and then the
82
+ > # plugin's API.
83
+ > api: ChatTriggersApi | None = get_chat_triggers_api(self.server.plugin_manager)
84
+ >
85
+ > # Since we're doing everything right, there
86
+ > # is little-to-no reason that this should
87
+ > # return None.
88
+ > assert api, "`get_chat_triggers_api` returned `None`"
89
+ > self.api: TwitchSpawnApi = api
90
+ >
91
+ > # Just like Endstone's register_events, you
92
+ > # can make a sperate listener class in a
93
+ > # different module to make >everything cleaner.
94
+ > self.api.register_events(self)
95
+ >
96
+ > @streamlabs_event_handler
97
+ > def on_twitch_follow(self, event: TwitchFollowEvent):
98
+ > # Simple test log so you can see that the
99
+ > # plugin's API is funcitonal.
100
+ > self.logger.info("Somebody followed!!")
101
+ > ```
102
+
103
+ <!-- -->
104
+
105
+ > <div class="animated-header-wrap">
106
+ > <h4><span class="highlight">Detailed</span> error logging</h4>
107
+ > </div>
108
+ >
109
+ > Catch errors in your workflows _before_ they get the chance to mess anything up.
110
+ >
111
+ > ```log
112
+ > [11:37:10 ERROR]: [ChatTriggers] error[E000]: invalid_workflow_file
113
+ > [11:37:10 ERROR]: [ChatTriggers] --> workflows/empty.yaml:1
114
+ > [11:37:10 ERROR]: [ChatTriggers] | ^ (source unavailable) — Workflow YAML file is empty
115
+ > [11:37:10 ERROR]: [ChatTriggers]
116
+ > [11:37:10 ERROR]: [ChatTriggers] 1 error emitted
117
+ > [11:37:10 ERROR]: [ChatTriggers] error[E001]: missing_workflow_name
118
+ > [11:37:10 ERROR]: [ChatTriggers] --> workflows/workflow_without_a_name.yaml:1
119
+ > [11:37:10 ERROR]: [ChatTriggers] 1 | event:
120
+ > [11:37:10 ERROR]: [ChatTriggers] | ^^^^^^ Add a 'name' field at the root of your YAML mapping.
121
+ > [11:37:10 ERROR]: [ChatTriggers]
122
+ > [11:37:10 ERROR]: [ChatTriggers] 1 error emitted
123
+ > [11:37:10 WARNING]: [ChatTriggers] warning[W012]: no_trigger_events
124
+ > [11:37:10 WARNING]: [ChatTriggers] --> workflows/no_events.yaml:1
125
+ > [11:37:10 WARNING]: [ChatTriggers] 1 | name: Workflow With No Events
126
+ > [11:37:10 WARNING]: [ChatTriggers] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Without an 'event', this workflow will never be triggered.
127
+ > [11:37:10 WARNING]: [ChatTriggers]
128
+ > [11:37:10 WARNING]: [ChatTriggers] 1 warning emitted
129
+ > ```
130
+ >
131
+ > ![Minecraft screenshot depicting logs in-game](assets/images/screenshot-logging.png)
132
+
133
+ <br />
134
+
135
+ # Start
136
+ <div class="grid cards" markdown>
137
+
138
+ - **Install ChatTriggers On Your Endstone Server**
139
+
140
+ ---
141
+
142
+ Follow the short guide to install and configure ChatTriggers on your Endstone server.
143
+
144
+ [**:octicons-arrow-right-24: Getting Started**](getting-started/installation.md)
145
+
146
+ </div>
147
+