Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

privacy update #6

Merged
merged 2 commits into from
Sep 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 13 additions & 13 deletions pkg/bouncerbot/bouncerbot.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,22 +176,22 @@ var messages = map[string][]string{
messageSuccessful: {"I found your info! I'll let you in now. :)"},
messageBadKey: {
"Sorry, that key did not work. The key should be 64 hexadecimal characters, sent as " +
"plain text a single message by itself.",
"If you still have trouble, reach out to the admins for help.",
"plain text in a single message by itself.",
"If you still have trouble, ask for help in the waiting room channel.",
},
messageNotFound: {"Sorry, that key did not work. Reach out to the admins for help!"},
messageNotFound: {"Sorry, that key did not work. Ask for help in the waiting room channel!"},
messageDecryptionError: {
"There was a decryption error with that key. Reach out to the admins for help!",
"There was a decryption error with that key. Ask for help in the waiting room channel!",
},
messageNickPerm: {
"Everything worked except I wasn't able to set your nickname because of your high role.",
"Please set your nickname by sending `/nick FIRST LAST` in one of the channels.",
},
messageAdmitError: {
"There was an error while trying to admit you. Reach out to the admins for help!",
"There was an error while trying to admit you. Ask for help in the waiting room channel!",
},
messageOtherError: {
"There was an error with a message I tried to send. Reach out to the admins to complain!",
"There was an error with a message I tried to send. Complain in the waiting room channel!",
},
}

Expand Down Expand Up @@ -221,25 +221,25 @@ func (b *Bot) admit(u *db.User, dID string) error {

var errs []error

err := b.GuildMemberNickname(b.Guild.GuildID, dID, u.Name)
if err != nil {
errs = append(errs, fmt.Errorf("set nick: %w", err))
}

rolesToAdd := b.Guild.GetRoleIDsForUser(b.l, u)

for _, roleID := range rolesToAdd {
err = b.GuildMemberRoleAdd(b.Guild.GuildID, dID, roleID)
err := b.GuildMemberRoleAdd(b.Guild.GuildID, dID, roleID)
if err != nil {
errs = append(errs, fmt.Errorf("set role '%s': %w", roleID, err))
}
}

err = b.GuildMemberRoleRemove(b.Guild.GuildID, dID, b.Guild.NewbieRole)
err := b.GuildMemberRoleRemove(b.Guild.GuildID, dID, b.Guild.NewbieRole)
if err != nil {
errs = append(errs, fmt.Errorf("remove newbie role: %w", err))
}

err = b.GuildMemberNickname(b.Guild.GuildID, dID, u.Name)
if err != nil {
errs = append(errs, fmt.Errorf("set nick: %w", err))
}

return errors.Join(errs...)
}

Expand Down