Skip to content

Commit

Permalink
Update Notifications.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
Abev08 committed Oct 29, 2023
1 parent 02324ac commit 98c1927
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Notifications.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static class Notifications
public static NotificationsConfig ConfigSubscriptionGiftReceived { get; set; } = new(NotificationType.SUBSCRIPTION);
public static NotificationsConfig ConfigCheer { get; set; } = new(NotificationType.CHEER);
public static NotificationsConfig ConfigRaid { get; set; } = new(NotificationType.RAID);
private static readonly string[] NotificationData = new string[8];
private static readonly string[] NotificationData = new string[14];
public static readonly List<ChannelRedemption> ChannelRedemptions = new();
private static readonly List<(DateTime time, string name)> GiftedSubs = new();
private static readonly TimeSpan GiftSubMaxTimeout = new(0, 0, 10);
Expand Down Expand Up @@ -159,6 +159,9 @@ public static void CreateSubscriptionNotification(string userName, string tier,
NotificationData[3] = streak.ToString();
NotificationData[5] = cumulative.ToString();
NotificationData[7] = message.Text; // TODO: Create message to read - remove emotes from the message using message.Emotes[], don't read them
NotificationData[10] = duration > 1 ? "s" : string.Empty;
NotificationData[11] = streak > 1 ? "s" : string.Empty;
NotificationData[13] = cumulative > 1 ? "s" : string.Empty;

Chat.AddMessageToQueue(string.Format(ConfigSubscriptionExt.ChatMessage, NotificationData));
AddNotification(new Notification(ConfigSubscriptionExt, NotificationData));
Expand Down Expand Up @@ -201,6 +204,7 @@ public static void CreateGiftSubscriptionNotification(string userName, string ti
NotificationData[4] = count.ToString();
NotificationData[6] = sb.ToString();
NotificationData[7] = message;
NotificationData[12] = count > 1 ? "s" : string.Empty;

Chat.AddMessageToQueue(string.Format(ConfigSubscriptionGift.ChatMessage, NotificationData));
AddNotification(new Notification(ConfigSubscriptionGift, NotificationData));
Expand Down Expand Up @@ -243,6 +247,7 @@ public static void CreateCheerNotification(string userName, int count, string me
NotificationData[0] = chatter;
NotificationData[4] = count.ToString();
NotificationData[7] = message;
NotificationData[12] = count > 1 ? "s" : string.Empty;

Chat.AddMessageToQueue(string.Format(ConfigCheer.ChatMessage, NotificationData));
AddNotification(new Notification(ConfigCheer, NotificationData));
Expand Down Expand Up @@ -308,6 +313,7 @@ public static void CreateRaidNotification(string userName, string userID, int co
Array.Clear(NotificationData);
NotificationData[0] = chatter;
NotificationData[4] = count.ToString();
NotificationData[12] = count > 1 ? "s" : string.Empty;

Chat.AddMessageToQueue(string.Format(ConfigRaid.ChatMessage, NotificationData));
if (ConfigRaid.DoShoutout) Chat.Shoutout(userID);
Expand Down

0 comments on commit 98c1927

Please sign in to comment.