more changes
This commit is contained in:
17
app.go
17
app.go
@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user