@@ -35,11 +35,12 @@ func (e Event) GenerateEvent(params events.MockEventParameters) (events.MockEven
35
35
var event []byte
36
36
var err error
37
37
lastUser := util .RandomUserID ()
38
- lastTotal := util .RandomViewerCount ( )
38
+ lastTotal := util .RandomInt ( 10 * 100 )
39
39
lastType := util .RandomType ()
40
+
40
41
//Local variables which will be used for the trigger params below
41
- localTotal := util .RandomViewerCount ( )
42
- localGoal := util .RandomViewerCount ()
42
+ localTotal := util .RandomInt ( 10 * 100 )
43
+ localGoal := util .RandomInt ( 10 * 100 * 100 ) + localTotal
43
44
localProgress := (localTotal / localGoal )
44
45
45
46
switch params .Transport {
@@ -64,12 +65,12 @@ func (e Event) GenerateEvent(params events.MockEventParameters) (events.MockEven
64
65
BroadcasterUserID : params .ToUserID ,
65
66
BroadcasterUserLogin : params .ToUserName ,
66
67
BroadcasterUserName : params .ToUserName ,
67
- Total : util . RandomViewerCount () ,
68
+ Total : localTotal ,
68
69
Progress : localProgress ,
69
70
Goal : localGoal ,
70
71
TopContributions : []models.ContributionData {
71
72
{
72
- TotalContribution : util .RandomViewerCount ( ),
73
+ TotalContribution : util .RandomInt ( 10 * 100 ),
73
74
TypeOfContribution : util .RandomType (),
74
75
UserWhoMadeContribution : util .RandomUserID (),
75
76
UserNameWhoMadeContribution : "cli_user1" ,
@@ -95,7 +96,7 @@ func (e Event) GenerateEvent(params events.MockEventParameters) (events.MockEven
95
96
},
96
97
}
97
98
if triggerMapping [params.Transport ][params.Trigger ] == "hype-train-end " {
98
- body .Event .CooldownEndsAtTimestamp = util .GetTimestamp ().Format (time .RFC3339Nano )
99
+ body .Event .CooldownEndsAtTimestamp = util .GetTimestamp ().Add ( 1 * time . Hour ). Format (time .RFC3339Nano )
99
100
}
100
101
event , err = json .Marshal (body )
101
102
if err != nil {
@@ -120,7 +121,7 @@ func (e Event) GenerateEvent(params events.MockEventParameters) (events.MockEven
120
121
TypeOfContribution : lastType ,
121
122
WebSubUser : lastUser ,
122
123
},
123
- Level : util .RandomViewerCount () % 4 ,
124
+ Level : util .RandomInt ( 4 ) + 1 ,
124
125
StartedAtTimestamp : util .GetTimestamp ().Format (time .RFC3339 ),
125
126
TopContributions : []models.ContributionData {
126
127
{
@@ -129,7 +130,7 @@ func (e Event) GenerateEvent(params events.MockEventParameters) (events.MockEven
129
130
WebSubUser : lastUser ,
130
131
},
131
132
{
132
- TotalContribution : util .RandomViewerCount ( ),
133
+ TotalContribution : util .RandomInt ( 10 * 100 ),
133
134
TypeOfContribution : util .RandomType (),
134
135
WebSubUser : util .RandomUserID (),
135
136
},
0 commit comments