UpdateDiscordLink links Discord to an existing user.
(ctx context.Context, userID, discordID, username string, avatar *string)
| 370 | |
| 371 | // UpdateDiscordLink links Discord to an existing user. |
| 372 | func (s *UsersStore) UpdateDiscordLink(ctx context.Context, userID, discordID, username string, avatar *string) error { |
| 373 | d := s.db.DB(ctx) |
| 374 | now := time.Now() |
| 375 | ts := pgtime.From(now) |
| 376 | return d.Queries.UpdateUserDiscordLink(ctx, db.UpdateUserDiscordLinkParams{ |
| 377 | ID: userID, |
| 378 | DiscordID: &discordID, |
| 379 | DiscordUsername: &username, |
| 380 | DiscordAvatar: avatar, |
| 381 | DiscordLinkedAt: ts, |
| 382 | }) |
| 383 | } |
| 384 | |
| 385 | // UpdateDiscordUnlink removes Discord from a user. |
| 386 | func (s *UsersStore) UpdateDiscordUnlink(ctx context.Context, userID string) error { |
no test coverage detected