forked from Shop-kins/SubnauticaTwitchInteractionMod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTwitchEventManager.cs
39 lines (34 loc) · 1.04 KB
/
TwitchEventManager.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
using TwitchInteraction.Player_Events;
namespace TwitchInteraction
{
class TwitchEventManager
{
public static void ChatMessageReceived(object sender, Message e)
{
if(e.Text.Trim() == ("{costs}"))
{
MainPatcher.TextChannel.SendMessageAsync(EventLookup.getBitCosts(), MainPatcher.cts);
}
}
public static void PubSubMessageReceived(object sender, Message e)
{
if (e.Host == ChannelPointsHost())
{
EventLookup.Lookup(e.Text, e.User);
}
if (e.Host == BitsHost())
{
EventLookup.Lookup(e.Text, e.User, Int32.Parse(e.Text.Split(':')[0]));
}
}
private static string ChannelPointsHost()
{
return "channel-points-channel-v1." + MainPatcher.secrets.nick_id;
}
private static string BitsHost()
{
return "channel-bits-events-v2." + MainPatcher.secrets.nick_id;
}
}
}