Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
AnatoleAM committed Dec 3, 2023
1 parent e99f33d commit 1942997
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 13 additions & 2 deletions internal/api/operations/sync_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,24 @@ import (

func SyncUser(gctx global.Context, ctx context.Context, req compactdisc.Request[compactdisc.RequestPayloadSyncUser]) error {
userID := req.Data.UserID
guildID := gctx.Config().Discord.GuildID

z := zap.S().Named("api/SyncUser").With(
"user_id", userID.Hex(),
"guild_id", guildID,
)

appRoles, err := gctx.Inst().Query.Roles(ctx, bson.M{})
if err != nil {
z.Errorw("failed to query roles", "error", err)

return err
}

user, err := gctx.Inst().Query.Users(ctx, bson.M{"_id": userID}).First()
if err != nil {
z.Errorw("failed to query user", "error", err)

return err
}

Expand All @@ -32,14 +42,15 @@ func SyncUser(gctx global.Context, ctx context.Context, req compactdisc.Request[
}

dis := gctx.Inst().Discord.Session()
guildID := gctx.Config().Discord.GuildID

z := zap.S().Named("api/SyncUser").With(
z = zap.S().Named("api/SyncUser").With(
"user_id", userID.Hex(),
"guild_id", guildID,
"discord_id", con.ID,
)

z.Debug()

member, err := dis.State.Member(guildID, con.ID)
if err != nil { // member is not in state, so we must fetch them
member, err = dis.GuildMember(guildID, con.ID)
Expand Down
2 changes: 1 addition & 1 deletion terraform/config.template.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Log level
level: info
level: debug

cdn_url: cdn.7tv.app
website_url: https://7tv.app
Expand Down

0 comments on commit 1942997

Please sign in to comment.