more changes

This commit is contained in:
Sticks
2025-05-19 18:26:52 -04:00
parent e40f82f636
commit 7aa2dee280
7 changed files with 218 additions and 22 deletions

17
app.go
View File

@ -98,6 +98,19 @@ func (a *App) startup(ctx context.Context, logger logger.Logger) {
}
// Greet returns a greeting for the given name
func (a *App) Greet(name string) string {
return fmt.Sprintf("Hello %s, It's show time!", name)
func (a *App) Greet(token string) string {
// Create fansly API instance
fanslyAPI := handlers.NewFanslyAPIController(token, a.Logger)
// Get the user info
account, accountErr := fanslyAPI.GetMe()
if accountErr != nil {
return "Failed to get account info: " + accountErr.Error()
}
// Print the response we got
a.Logger.Info(fmt.Sprintf("[Greet] Account info: %+v", account))
// Return the greeting
return fmt.Sprintf("Hello %s! You have %d fans and %d posts likes.", account.Username, account.FollowCount, account.PostLikes)
}