Skip to content

Commit

Permalink
feat: rewrite discord bot logic
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Trost <[email protected]>
  • Loading branch information
galexrt committed May 19, 2024
1 parent d7ae4e2 commit f1caedf
Show file tree
Hide file tree
Showing 27 changed files with 8,119 additions and 9,676 deletions.
2 changes: 1 addition & 1 deletion gen/go/proto/resources/qualifications/qualifications.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions gen/go/proto/resources/users/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ func (x *JobProps) Default(job string) {
EmployeeRoleEnabled: true,
UnemployedEnabled: false,
UnemployedMode: UserInfoSyncUnemployedMode_USER_INFO_SYNC_UNEMPLOYED_MODE_GIVE_ROLE,
SyncNicknames: true,
GroupMapping: []*GroupMapping{},
}
}

Expand Down Expand Up @@ -191,3 +193,24 @@ func (x *JobSettings) Value() (driver.Value, error) {
out, err := protoutils.Marshal(x)
return string(out), err
}

// Scan implements driver.Valuer for protobuf DiscordSyncDiff.
func (x *DiscordSyncDiff) Scan(value any) error {
switch t := value.(type) {
case string:
return protojson.Unmarshal([]byte(t), x)
case []byte:
return protojson.Unmarshal(t, x)
}
return nil
}

// Value marshals the value into driver.Valuer.
func (x *DiscordSyncDiff) Value() (driver.Value, error) {
if x == nil {
return nil, nil
}

out, err := protoutils.Marshal(x)
return string(out), err
}
Loading

0 comments on commit f1caedf

Please sign in to comment.