Fixed link command
This commit is contained in:
parent
0bf31df81e
commit
1ecb5873ee
1 changed files with 6 additions and 2 deletions
8
main.go
8
main.go
|
@ -124,13 +124,15 @@ func scrape(liveChatID string) {
|
|||
// Iterate through each live chat message
|
||||
for _, item := range responseJSON.Items {
|
||||
println("Processing message from ", item.AutorDetails.DisplayName)
|
||||
println("Message: ", item.Snippet.TextMessageDetails.MessageText)
|
||||
// Check if the message starts with !verify
|
||||
if strings.HasPrefix(item.Snippet.TextMessageDetails.MessageText, "!verify ") {
|
||||
if strings.HasPrefix(item.Snippet.TextMessageDetails.MessageText, "!link ") {
|
||||
println("User ", item.AutorDetails.DisplayName, " is verifying")
|
||||
// Get the channel ID
|
||||
channelID := item.AutorDetails.ChannelID
|
||||
|
||||
// Check if the user is in pendingSessions
|
||||
pendingSession, ok := pendingSessions[strings.TrimPrefix("!verify ", item.Snippet.TextMessageDetails.MessageText)]
|
||||
pendingSession, ok := pendingSessions[strings.TrimPrefix(item.Snippet.TextMessageDetails.MessageText, "!link ")]
|
||||
if !ok {
|
||||
// This user does not need to be verified
|
||||
continue
|
||||
|
@ -195,6 +197,8 @@ func getLiveChatID(videoID string) string {
|
|||
panic("Error decoding JSON: " + err.Error())
|
||||
}
|
||||
|
||||
println(responseJSON)
|
||||
|
||||
liveChatID := responseJSON["items"].([]interface{})[0].(map[string]interface{})["liveStreamingDetails"].(map[string]interface{})["activeLiveChatId"].(string)
|
||||
|
||||
return liveChatID
|
||||
|
|
Loading…
Add table
Reference in a new issue