Skip to content

Commit

Permalink
fix: remove discord bot where condition for testing
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 e144d75 commit 5b7c6e3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 3 additions & 1 deletion gen/go/proto/services/jobs/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ func (s *Server) GetMOTD(ctx context.Context, req *GetMOTDRequest) (*GetMOTDResp
tJobProps.Motd.AS("getmotdresponse.motd"),
).
FROM(tJobProps).
WHERE(tJobProps.Job.EQ(jet.String(userInfo.Job))).
WHERE(
tJobProps.Job.EQ(jet.String(userInfo.Job)),
).
LIMIT(1)

resp := &GetMOTDResponse{}
Expand Down
1 change: 0 additions & 1 deletion pkg/discord/bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,6 @@ func (b *Bot) getJobGuildsFromDB(ctx context.Context) (map[string]string, error)
FROM(tJobProps).
WHERE(jet.AND(
tJobProps.DiscordGuildID.IS_NOT_NULL(),
tJobProps.Job.EQ(jet.String("ambulance")),
))

var dest []*struct {
Expand Down
8 changes: 4 additions & 4 deletions pkg/discord/modules/groupsync.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ import (
"go.uber.org/zap"
)

const DefaultGroupSyncRoleColor = "#9B59B6"
const defaultGroupSyncRoleColor = "#9B59B6"

type GroupSync struct {
*BaseModule
}

type GroupSyncUser struct {
type groupSyncUser struct {
ExternalID string `alias:"external_id"`
Group string `alias:"group"`
License string `alias:"license"`
Expand Down Expand Up @@ -67,7 +67,7 @@ func (g *GroupSync) planRoles() []*types.Role {

i := 0
for _, dcRole := range dcRoles {
color := DefaultGroupSyncRoleColor
color := defaultGroupSyncRoleColor
if dcRole.Color != "" {
color = dcRole.Color
}
Expand Down Expand Up @@ -120,7 +120,7 @@ func (g *GroupSync) planUsers(ctx context.Context, roles types.Roles) (types.Use
tUsers.Group.IN(serverGroups...),
))

var dest []*GroupSyncUser
var dest []*groupSyncUser
if err := stmt.QueryContext(ctx, g.db, &dest); err != nil {
if !errors.Is(err, qrm.ErrNoRows) {
return users, logs, err
Expand Down
4 changes: 2 additions & 2 deletions pkg/discord/modules/userinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type UserInfo struct {
nicknameRegex *regexp.Regexp
}

type UserRoleMapping struct {
type userRoleMapping struct {
AccountID uint64 `alias:"account_id"`
ExternalID string `alias:"external_id"`
JobGrade int32 `alias:"job_grade"`
Expand Down Expand Up @@ -206,7 +206,7 @@ func (g *UserInfo) planUsers(ctx context.Context, roles types.Roles) (types.User
)).
ORDER_BY(tUsers.ID.ASC())

var dest []*UserRoleMapping
var dest []*userRoleMapping
if err := stmt.QueryContext(ctx, g.db, &dest); err != nil {
if !errors.Is(err, qrm.ErrNoRows) {
return users, logs, err
Expand Down

0 comments on commit 5b7c6e3

Please sign in to comment.