package command import ( "fmt" "himbot/lib" "github.com/bwmarrin/discordgo" ) func ShopCommand(s *discordgo.Session, i *discordgo.InteractionCreate) (string, error) { options := i.ApplicationCommandData().Options if len(options) == 0 { return "Welcome to the Himbucks Shop! Use `/shop buy` to purchase items.", nil } if options[0].Name == "buy" { subOptions := options[0].Options if len(subOptions) == 0 { return "Please specify an item to buy.", nil } item := subOptions[0].StringValue() user, err := lib.GetUser(i) if err != nil { return "", err } switch item { case "pizza": cost, newBalance, err := lib.BuyPizza(user.ID, i.GuildID) if err != nil { return fmt.Sprintf("❌ %s", err.Error()), nil } return fmt.Sprintf("Here is your pizza, %s!\n**Cost:** %d himbucks\n**Remaining Balance:** %d himbucks\n```\n%s\n```", user.Username, cost, newBalance, getPizzaArt()), nil case "multiplier": newMult, cost, newBalance, err := lib.BuyMultiplier(user.ID, i.GuildID) if err != nil { return fmt.Sprintf("❌ %s", err.Error()), nil } return fmt.Sprintf("Multiplier upgraded!\nYou spent **%d** himbucks.\nYour new earning multiplier is **%.1fx**!\n**Remaining Balance:** %d himbucks", cost, newMult, newBalance), nil default: return fmt.Sprintf("Unknown item: %s", item), nil } } return "Unknown subcommand.", nil } func getPizzaArt() string { return ` // ""--.._ || (_) _ "-._ || _ (_) '-. || (_) __..-' \__..--"` }