Skip to content

Commit

Permalink
Add blog to entityinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
cheesycod authored Jun 3, 2024
1 parent 8b03ddc commit fca329a
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions votes/helpers.go
Original file line number Diff line number Diff line change
@@ -97,8 +97,8 @@ func GetEntityInfo(ctx context.Context, targetId, targetType string) (*EntityInf

// Set entityInfo for log
return &EntityInfo{
URL: "https://botlist.site/team/" + targetId,
VoteURL: "https://botlist.site/team/" + targetId + "/vote",
URL: state.Config.Sites.Frontend.Parse() + "/team/" + targetId,
VoteURL: state.Config.Sites.Frontend.Parse() + "/team/" + targetId + "/vote",
Name: name,
Avatar: avatarPath,
}, nil
@@ -120,13 +120,19 @@ func GetEntityInfo(ctx context.Context, targetId, targetType string) (*EntityInf
return nil, errors.New("server is vote banned and cannot be voted for right now")
}

// Set entityInfo for log
return &EntityInfo{
URL: "https://botlist.site/server/" + targetId,
VoteURL: "https://botlist.site/server/" + targetId + "/vote",
// Set entityInfo for log
return &EntityInfo{
URL: state.Config.Sites.Frontend.Parse()+ "/server/" + targetId,
VoteURL: state.Config.Sites.Frontend.Parse() + "/server/" + targetId + "/vote",
Name: name,
Avatar: avatar,
}, nil
case "blog":
return &EntityInfo{
URL: state.Config.Sites.Frontend.Parse() + "/blog/" + targetId,
VoteURL: state.Config.Sites.Frontend.Parse() + "/blog/" + targetId,
Name: targetId,
}, nil
default:
return nil, errors.New("unimplemented target type:" + targetType)
}

0 comments on commit fca329a

Please sign in to comment.