|
|
@ -9,10 +9,9 @@ import (
|
|
|
|
"TerraOceanBot/server"
|
|
|
|
"TerraOceanBot/server"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
func UpdateVoiceChannelState(s *discordgo.Session) {
|
|
|
|
func UpdateVoiceChannelState(s *discordgo.Session, guild *discordgo.GuildCreate) {
|
|
|
|
for _, guild := range s.State.Guilds {
|
|
|
|
|
|
|
|
if guild.ID != config.GuildID {
|
|
|
|
if guild.ID != config.GuildID {
|
|
|
|
continue
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for _, vs := range guild.VoiceStates {
|
|
|
|
for _, vs := range guild.VoiceStates {
|
|
|
|
if vs.ChannelID != config.VoiceChannel {
|
|
|
|
if vs.ChannelID != config.VoiceChannel {
|
|
|
@ -26,13 +25,11 @@ func UpdateVoiceChannelState(s *discordgo.Session) {
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
message.AuditError(s, "", err)
|
|
|
|
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
}
|
|
|
|
server.ConnectUser(username)
|
|
|
|
server.ConnectUser(username)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func VoiceStateUpdate(s *discordgo.Session, vs *discordgo.VoiceState) {
|
|
|
|
func VoiceStateUpdate(s *discordgo.Session, vs *discordgo.VoiceState) {
|
|
|
|
username, err := db.GetMinecraftUsername(vs.UserID)
|
|
|
|
username, err := db.GetMinecraftUsername(vs.UserID)
|
|
|
|