@@ -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 {
@@ -63,12 +64,12 @@ func (e Event) GenerateEvent(params events.MockEventParameters) (events.MockEven
63
64
BroadcasterUserID : params .ToUserID ,
64
65
BroadcasterUserLogin : params .ToUserName ,
65
66
BroadcasterUserName : params .ToUserName ,
66
- Total : util . RandomViewerCount () ,
67
+ Total : localTotal ,
67
68
Progress : localProgress ,
68
69
Goal : localGoal ,
69
70
TopContributions : []models.ContributionData {
70
71
{
71
- TotalContribution : util .RandomViewerCount ( ),
72
+ TotalContribution : util .RandomInt ( 10 * 100 ),
72
73
TypeOfContribution : util .RandomType (),
73
74
UserWhoMadeContribution : util .RandomUserID (),
74
75
UserNameWhoMadeContribution : "cli_user1" ,
@@ -94,7 +95,7 @@ func (e Event) GenerateEvent(params events.MockEventParameters) (events.MockEven
94
95
},
95
96
}
96
97
if triggerMapping [params.Transport ][params.Trigger ] == "hype-train-end " {
97
- body .Event .CooldownEndsAtTimestamp = util .GetTimestamp ().Format (time .RFC3339Nano )
98
+ body .Event .CooldownEndsAtTimestamp = util .GetTimestamp ().Add ( 1 * time . Hour ). Format (time .RFC3339Nano )
98
99
}
99
100
event , err = json .Marshal (body )
100
101
if err != nil {
@@ -119,7 +120,7 @@ func (e Event) GenerateEvent(params events.MockEventParameters) (events.MockEven
119
120
TypeOfContribution : lastType ,
120
121
WebSubUser : lastUser ,
121
122
},
122
- Level : util .RandomViewerCount () % 4 ,
123
+ Level : util .RandomInt ( 4 ) + 1 ,
123
124
StartedAtTimestamp : util .GetTimestamp ().Format (time .RFC3339 ),
124
125
TopContributions : []models.ContributionData {
125
126
{
@@ -128,7 +129,7 @@ func (e Event) GenerateEvent(params events.MockEventParameters) (events.MockEven
128
129
WebSubUser : lastUser ,
129
130
},
130
131
{
131
- TotalContribution : util .RandomViewerCount ( ),
132
+ TotalContribution : util .RandomInt ( 10 * 100 ),
132
133
TypeOfContribution : util .RandomType (),
133
134
WebSubUser : util .RandomUserID (),
134
135
},
0 commit comments