This commit is contained in:
2
main.go
2
main.go
@@ -272,6 +272,7 @@ func createPrivateVCAndMove(
|
|||||||
}
|
}
|
||||||
|
|
||||||
go watchAndCleanup(s, guildID, newChan.ID, time.Duration(timeoutMin)*time.Minute)
|
go watchAndCleanup(s, guildID, newChan.ID, time.Duration(timeoutMin)*time.Minute)
|
||||||
|
log.Println("➕ Added channel for guildID: " + guildID + " with new ID: " + newChan.ID)
|
||||||
return newChan, nil
|
return newChan, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -301,6 +302,7 @@ func watchAndCleanup(s *discordgo.Session, guildID, channelID string, timeout ti
|
|||||||
}
|
}
|
||||||
if time.Since(lastActive) >= timeout {
|
if time.Since(lastActive) >= timeout {
|
||||||
_, _ = s.ChannelDelete(channelID)
|
_, _ = s.ChannelDelete(channelID)
|
||||||
|
log.Println("➖ Deleted channel for guildID: " + guildID + " with ID: " + channelID)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user