s.ChannelMessageSend(m.ChannelID,"You have sent an invalid SITNET ID. Your SITNET ID is your SUNY Poly email address, up until the @sunypoly.edu. For example, urbanc@sunypoly.edu would have a SITNET ID of urbanc. He would say `!sitnet urbanc`")
return
}
v.SITNET=parts[1]
v.sendEmail()
pendingV[k]=v
s.ChannelMessageSend(m.ChannelID,fmt.Sprintf("Thanks! I have sent an email to %+v@sunypoly.edu from %+v with further instructions.",v.SITNET,config.MyEmail))
}
ifstrings.HasPrefix(m.Content,"!verify"){
iflen(parts)!=3{
s.ChannelMessageSend(m.ChannelID,"You have sent an invalid verification, please ensure you are sending ```!verify $code $minecraftID``` Please ensure there are no extra spaces, also your minecraftID is case sensitive.")
return
}
ifparts[1]!=v.Code{
s.ChannelMessageSend(m.ChannelID,"You have sent an invalid verification code, please verify using the code from your email.")
return
}
varuUser
u.DiscordID=v.DiscordID
u.Email=v.SITNET
u.McUser=strings.Replace(parts[2],"$","",-1)
ifv.SITNET==parts[2]{
s.ChannelMessageSend(m.ChannelID,"SITNET Can not be the same as Minecraft Username. Please append a dollar sign to the end of your minecraft username if it actually is the same as your sitnet. For example urbanc would put urbanc$ as his minecraft username to dismiss this message.")
return
}
log.LogDebug(fmt.Sprintf("Attempting to write %+v from verification %+v",u,v))
err:=u.Write()
iferr!=nil{
s.ChannelMessageSend(m.ChannelID,"There was an issue with your verification. Please check in with an administrator in the #unverified channel.")
return
}
u.McWhitelist()
s.ChannelMessageSend(m.ChannelID,"Welcome! You have successfully verified. The server address is polymc.cs.sunyit.edu - see you there!")