|
|
|
@ -63,7 +63,7 @@ var viewTrustLevel = adminOnly(func(s *discordgo.Session, m *discordgo.MessageCr
|
|
|
|
|
).Send(s, m.ChannelID)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
value, err := backend.GetTrust(s, command[1])
|
|
|
|
|
value, err := backend.GetTrust(s, user.User.ID)
|
|
|
|
|
if err != nil {
|
|
|
|
|
message.AuditError(s, m.ChannelID, err)
|
|
|
|
|
return
|
|
|
|
@ -97,6 +97,8 @@ var viewTrustLevel = adminOnly(func(s *discordgo.Session, m *discordgo.MessageCr
|
|
|
|
|
rand.Read(salt)
|
|
|
|
|
|
|
|
|
|
//Generate message
|
|
|
|
|
hash := sha512.New()
|
|
|
|
|
hash.Write(salt)
|
|
|
|
|
msg := message.NewEmbed().SetColour(config.VTLColour).SetTitle(config.VTLGlobalTitle)
|
|
|
|
|
for _, v := range members {
|
|
|
|
|
value, err := backend.GetTrust(s, v.User.ID)
|
|
|
|
@ -111,9 +113,8 @@ var viewTrustLevel = adminOnly(func(s *discordgo.Session, m *discordgo.MessageCr
|
|
|
|
|
if len(command) > 1 {
|
|
|
|
|
username = v.User.Username + "#" + v.User.Discriminator
|
|
|
|
|
} else {
|
|
|
|
|
saltedUsername := []byte(v.User.Username + "#" + v.User.Discriminator)
|
|
|
|
|
saltedUsername = append(saltedUsername, salt...)
|
|
|
|
|
username = hex.EncodeToString(sha512.New().Sum(saltedUsername))[:64]
|
|
|
|
|
toSalt := []byte(v.User.Username + "#" + v.User.Discriminator)
|
|
|
|
|
username = hex.EncodeToString(hash.Sum(toSalt))[:64]
|
|
|
|
|
if username == "" {
|
|
|
|
|
username = "<cannot calculate hash>"
|
|
|
|
|
}
|
|
|
|
|