@@ -4,4 +4,91 @@ description: C# enum definition for EventSource
44name : EventSource
55---
66
7- : wip
7+ Within any action, the value of the ` eventSource ` variable can be retrieved using the ` CPH.GetSource() ` method, which returns an ` EventSource ` enum value.
8+
9+ This enum represents the source of the event that triggered the action.
10+
11+ ## Usage Example
12+
13+ :: warning
14+ To use the ` EventSource ` enum in your C# scripts, you must include the ` Streamer.bot.Common.Events ` namespace
15+ ::
16+
17+ : read-more { to =/api/csharp/methods/core/events/get-source }
18+
19+ ``` csharp
20+ using System ;
21+ using Streamer .bot .Common .Events ; // Add Events namespace
22+
23+ public class CPHInline
24+ {
25+ public bool Execute ()
26+ {
27+ // Get the EventSource for the current action
28+ EventSource source = CPH .GetSource ();
29+
30+ // Compare EventSource with switch or if
31+ switch (source )
32+ {
33+ case EventSource .Twitch :
34+ // Do something with Twitch events...
35+ break ;
36+ case EventSource .YouTube :
37+ // Do something with YouTube events...
38+ break ;
39+ }
40+
41+ return true ;
42+ }
43+ }
44+ ```
45+
46+ ## Enum Values
47+
48+ | Value | Description |
49+ | --------------------------------- | ---------------------------------------------- |
50+ | EventSource.Application | [ No description provied] {.text-muted .text-xs} |
51+ | EventSource.Command | [ No description provied] {.text-muted .text-xs} |
52+ | EventSource.CrowdControl | [ No description provied] {.text-muted .text-xs} |
53+ | EventSource.Custom | [ No description provied] {.text-muted .text-xs} |
54+ | EventSource.DonorDrive | [ No description provied] {.text-muted .text-xs} |
55+ | EventSource.Elgato | [ No description provied] {.text-muted .text-xs} |
56+ | EventSource.FileTail | [ No description provied] {.text-muted .text-xs} |
57+ | EventSource.FileWatcher | [ No description provied] {.text-muted .text-xs} |
58+ | EventSource.Fourthwall | [ No description provied] {.text-muted .text-xs} |
59+ | EventSource.General | [ No description provied] {.text-muted .text-xs} |
60+ | EventSource.Group | [ No description provied] {.text-muted .text-xs} |
61+ | EventSource.HypeRate | [ No description provied] {.text-muted .text-xs} |
62+ | EventSource.Inputs | [ No description provied] {.text-muted .text-xs} |
63+ | EventSource.Invalid | [ No description provied] {.text-muted .text-xs} |
64+ | EventSource.Kick | [ No description provied] {.text-muted .text-xs} |
65+ | EventSource.Kofi | [ No description provied] {.text-muted .text-xs} |
66+ | EventSource.MeldStudio | [ No description provied] {.text-muted .text-xs} |
67+ | EventSource.Midi | [ No description provied] {.text-muted .text-xs} |
68+ | EventSource.Misc | [ No description provied] {.text-muted .text-xs} |
69+ | EventSource.Obs | [ No description provied] {.text-muted .text-xs} |
70+ | EventSource.Pallygg | [ No description provied] {.text-muted .text-xs} |
71+ | EventSource.Patreon | [ No description provied] {.text-muted .text-xs} |
72+ | EventSource.Pulsoid | [ No description provied] {.text-muted .text-xs} |
73+ | EventSource.Quote | [ No description provied] {.text-muted .text-xs} |
74+ | EventSource.Raw | [ No description provied] {.text-muted .text-xs} |
75+ | EventSource.Shopify | [ No description provied] {.text-muted .text-xs} |
76+ | EventSource.SpeakerBot | [ No description provied] {.text-muted .text-xs} |
77+ | EventSource.SpeechToText | [ No description provied] {.text-muted .text-xs} |
78+ | EventSource.StreamDeck | [ No description provied] {.text-muted .text-xs} |
79+ | EventSource.StreamElements | [ No description provied] {.text-muted .text-xs} |
80+ | EventSource.StreamerBot | [ No description provied] {.text-muted .text-xs} |
81+ | EventSource.StreamerBotRemote | [ No description provied] {.text-muted .text-xs} |
82+ | EventSource.Streamlabs | [ No description provied] {.text-muted .text-xs} |
83+ | EventSource.StreamlabsDesktop | [ No description provied] {.text-muted .text-xs} |
84+ | EventSource.System | [ No description provied] {.text-muted .text-xs} |
85+ | EventSource.ThrowingSystem | [ No description provied] {.text-muted .text-xs} |
86+ | EventSource.TipeeeStream | [ No description provied] {.text-muted .text-xs} |
87+ | EventSource.TreatStream | [ No description provied] {.text-muted .text-xs} |
88+ | EventSource.Trovo | [ No description provied] {.text-muted .text-xs} |
89+ | EventSource.Twitch | [ No description provied] {.text-muted .text-xs} |
90+ | EventSource.VoiceMod | [ No description provied] {.text-muted .text-xs} |
91+ | EventSource.VTubeStudio | [ No description provied] {.text-muted .text-xs} |
92+ | EventSource.WebsocketClient | [ No description provied] {.text-muted .text-xs} |
93+ | EventSource.WebsocketCustomServer | [ No description provied] {.text-muted .text-xs} |
94+ | EventSource.YouTube | [ No description provied] {.text-muted .text-xs} |
0 commit comments