-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(eventsub): retry deadline subscribe
- Loading branch information
Showing
3 changed files
with
48 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package manager | ||
|
||
import ( | ||
model "github.com/satont/twir/libs/gomodels" | ||
) | ||
|
||
func getTypeCondition( | ||
t model.EventsubConditionType, | ||
topic, | ||
channelID, | ||
botId string, | ||
) map[string]string { | ||
switch t { | ||
case model.EventsubConditionTypeBroadcasterUserID: | ||
return map[string]string{ | ||
"broadcaster_user_id": channelID, | ||
} | ||
case model.EventsubConditionTypeUserID: | ||
return map[string]string{ | ||
"user_id": channelID, | ||
} | ||
case model.EventsubConditionTypeBroadcasterWithUserID: | ||
data := map[string]string{ | ||
"broadcaster_user_id": channelID, | ||
"user_id": botId, | ||
} | ||
if topic == "channel.follow" { | ||
data["user_id"] = channelID | ||
} | ||
return data | ||
case model.EventsubConditionTypeBroadcasterWithModeratorID: | ||
return map[string]string{ | ||
"broadcaster_user_id": channelID, | ||
"moderator_user_id": botId, | ||
} | ||
case model.EventsubConditionTypeToBroadcasterID: | ||
return map[string]string{ | ||
"to_broadcaster_user_id": channelID, | ||
} | ||
default: | ||
return nil | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters