Skip to content

Commit 997276b

Browse files
authored
Feature/add twitch event sub actions (#106)
* Moved some twitch triggers around Also added hype train related event triggers * Added more twitch events Also refactored some more * Added goal triggers * Added more twitch event sub triggers * Fixed poll scopes * Added missing scope and donation event trigger * Added prediction based triggers
1 parent 93c26df commit 997276b

File tree

59 files changed

+1422
-43
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1422
-43
lines changed

src/Strem.Twitch/Components/ScopeCollections.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class ScopeCollections
1212
{
1313
ApiScopes.ReadChannelGoals, ApiScopes.ReadBits, ApiScopes.ReadChannelPolls, ApiScopes.ReadChannelPredictions,
1414
ApiScopes.ReadChannelRedemptions, ApiScopes.ReadChannelSubscriptions, ApiScopes.ReadChannelVips,
15-
ApiScopes.ReadChannelHypeTrain
15+
ApiScopes.ReadChannelHypeTrain, ApiScopes.ReadCharity
1616
};
1717

1818
public static string[] ManageChannelScopes = new[]
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@using Microsoft.AspNetCore.Components
2+
@using Strem.Core.Types
3+
@using TwitchLib.Client.Enums
4+
5+
@inherits CustomTriggerComponent<Strem.Twitch.Flows.Triggers.Channel.OnTwitchCharityCampaignDonationTriggerData>
6+
7+
<div class="field">
8+
<label class="label">Required Channel</label>
9+
<div class="control">
10+
<ProcessedInput @bind-Value="Data.RequiredChannel" Placeholder="i.e A channel name, or leave blank for yours"></ProcessedInput>
11+
</div>
12+
<HelperInfo>This is optional and lets you only trigger if it matches a specific channel, leave blank to trigger on your own channel</HelperInfo>
13+
</div>
14+
15+
@code {
16+
public override string Title => GenerateTitle();
17+
18+
public string GenerateTitle()
19+
{
20+
var channelBlurb = !string.IsNullOrEmpty(Data.RequiredChannel) ? $"On Channel {Data.RequiredChannel}" : "";
21+
return $"Trigger On Charity Donation <strong>{channelBlurb}</strong>";
22+
}
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@using Microsoft.AspNetCore.Components
2+
@using Strem.Core.Types
3+
@using TwitchLib.Client.Enums
4+
5+
@inherits CustomTriggerComponent<Strem.Twitch.Flows.Triggers.Channel.OnTwitchCheerTriggerData>
6+
7+
<div class="field">
8+
<label class="label">Required Channel</label>
9+
<div class="control">
10+
<ProcessedInput @bind-Value="Data.RequiredChannel" Placeholder="i.e A channel name, or leave blank for yours"></ProcessedInput>
11+
</div>
12+
<HelperInfo>This is optional and lets you only trigger if it matches a specific channel, leave blank to trigger on your own channel</HelperInfo>
13+
</div>
14+
15+
@code {
16+
public override string Title => GenerateTitle();
17+
18+
public string GenerateTitle()
19+
{
20+
var channelBlurb = !string.IsNullOrEmpty(Data.RequiredChannel) ? $"On Channel {Data.RequiredChannel}" : "";
21+
return $"Trigger On Cheer <strong>{channelBlurb}</strong>";
22+
}
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@using Microsoft.AspNetCore.Components
2+
@using Strem.Core.Types
3+
@using TwitchLib.Client.Enums
4+
5+
@inherits CustomTriggerComponent<Strem.Twitch.Flows.Triggers.Channel.OnTwitchGoalEndTriggerData>
6+
7+
<div class="field">
8+
<label class="label">Required Channel</label>
9+
<div class="control">
10+
<ProcessedInput @bind-Value="Data.RequiredChannel" Placeholder="i.e A channel name, or leave blank for yours"></ProcessedInput>
11+
</div>
12+
<HelperInfo>This is optional and lets you only trigger if it matches a specific channel, leave blank to trigger on your own channel</HelperInfo>
13+
</div>
14+
15+
@code {
16+
public override string Title => GenerateTitle();
17+
18+
public string GenerateTitle()
19+
{
20+
var channelBlurb = !string.IsNullOrEmpty(Data.RequiredChannel) ? $"On Channel {Data.RequiredChannel}" : "";
21+
return $"Trigger On Goal Ended <strong>{channelBlurb}</strong>";
22+
}
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@using Microsoft.AspNetCore.Components
2+
@using Strem.Core.Types
3+
@using TwitchLib.Client.Enums
4+
5+
@inherits CustomTriggerComponent<Strem.Twitch.Flows.Triggers.Channel.OnTwitchGoalStartTriggerData>
6+
7+
<div class="field">
8+
<label class="label">Required Channel</label>
9+
<div class="control">
10+
<ProcessedInput @bind-Value="Data.RequiredChannel" Placeholder="i.e A channel name, or leave blank for yours"></ProcessedInput>
11+
</div>
12+
<HelperInfo>This is optional and lets you only trigger if it matches a specific channel, leave blank to trigger on your own channel</HelperInfo>
13+
</div>
14+
15+
@code {
16+
public override string Title => GenerateTitle();
17+
18+
public string GenerateTitle()
19+
{
20+
var channelBlurb = !string.IsNullOrEmpty(Data.RequiredChannel) ? $"On Channel {Data.RequiredChannel}" : "";
21+
return $"Trigger On Goal Started <strong>{channelBlurb}</strong>";
22+
}
23+
}

src/Strem.Twitch/Components/Triggers/Chat/OnTwitchHostedTriggerComponent.razor renamed to src/Strem.Twitch/Components/Triggers/Channel/OnTwitchHostedTriggerComponent.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
@using Strem.Core.Types
33
@using TwitchLib.Client.Enums
44

5-
@inherits CustomTriggerComponent<Strem.Twitch.Flows.Triggers.Chat.OnTwitchHostedTriggerData>
5+
@inherits CustomTriggerComponent<Strem.Twitch.Flows.Triggers.Channel.OnTwitchHostedTriggerData>
66

77
<div class="field">
88
<label class="label">Required Channel</label>

src/Strem.Twitch/Components/Triggers/Chat/OnTwitchHostingTriggerComponent.razor renamed to src/Strem.Twitch/Components/Triggers/Channel/OnTwitchHostingTriggerComponent.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
@using Strem.Core.Types
33
@using TwitchLib.Client.Enums
44

5-
@inherits CustomTriggerComponent<Strem.Twitch.Flows.Triggers.Chat.OnTwitchHostingTriggerData>
5+
@inherits CustomTriggerComponent<Strem.Twitch.Flows.Triggers.Channel.OnTwitchHostingTriggerData>
66

77
<div class="field">
88
<label class="label">Required Channel</label>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@using Microsoft.AspNetCore.Components
2+
@using Strem.Core.Types
3+
@using TwitchLib.Client.Enums
4+
5+
@inherits CustomTriggerComponent<Strem.Twitch.Flows.Triggers.Channel.OnTwitchHypeTrainEndTriggerData>
6+
7+
<div class="field">
8+
<label class="label">Required Channel</label>
9+
<div class="control">
10+
<ProcessedInput @bind-Value="Data.RequiredChannel" Placeholder="i.e A channel name, or leave blank for yours"></ProcessedInput>
11+
</div>
12+
<HelperInfo>This is optional and lets you only trigger if it matches a specific channel, leave blank to trigger on your own channel</HelperInfo>
13+
</div>
14+
15+
@code {
16+
public override string Title => GenerateTitle();
17+
18+
public string GenerateTitle()
19+
{
20+
var channelBlurb = !string.IsNullOrEmpty(Data.RequiredChannel) ? $"On Channel {Data.RequiredChannel}" : "";
21+
return $"Trigger On Hype Train Ended <strong>{channelBlurb}</strong>";
22+
}
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@using Microsoft.AspNetCore.Components
2+
@using Strem.Core.Types
3+
@using TwitchLib.Client.Enums
4+
5+
@inherits CustomTriggerComponent<Strem.Twitch.Flows.Triggers.Channel.OnTwitchHypeTrainStartTriggerData>
6+
7+
<div class="field">
8+
<label class="label">Required Channel</label>
9+
<div class="control">
10+
<ProcessedInput @bind-Value="Data.RequiredChannel" Placeholder="i.e A channel name, or leave blank for yours"></ProcessedInput>
11+
</div>
12+
<HelperInfo>This is optional and lets you only trigger if it matches a specific channel, leave blank to trigger on your own channel</HelperInfo>
13+
</div>
14+
15+
@code {
16+
public override string Title => GenerateTitle();
17+
18+
public string GenerateTitle()
19+
{
20+
var channelBlurb = !string.IsNullOrEmpty(Data.RequiredChannel) ? $"On Channel {Data.RequiredChannel}" : "";
21+
return $"Trigger On Hype Train Started <strong>{channelBlurb}</strong>";
22+
}
23+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@inherits CustomTriggerComponent<Strem.Twitch.Flows.Triggers.Channel.OnTwitchPollEndTriggerData>
2+
3+
<div class="field">
4+
<label class="label">Required Channel</label>
5+
<div class="control">
6+
<ProcessedInput @bind-Value="Data.RequiredChannel" Placeholder="i.e A channel name, or leave blank for yours"></ProcessedInput>
7+
</div>
8+
<HelperInfo>This is optional and lets you only trigger if it matches a specific channel, leave blank to trigger on your own channel</HelperInfo>
9+
</div>
10+
11+
@code {
12+
public override string Title => GenerateTitle();
13+
14+
public string GenerateTitle()
15+
{
16+
var channelBlurb = !string.IsNullOrEmpty(Data.RequiredChannel) ? $"On Channel {Data.RequiredChannel}" : "";
17+
return $"Trigger On Poll Ended <strong>{channelBlurb}</strong>";
18+
}
19+
}

0 commit comments

Comments
 (0)