Limited maxCards to 4
This commit is contained in:
parent
4e51cfeba5
commit
61302ce9bc
2 changed files with 2 additions and 12 deletions
|
|
@ -12,15 +12,6 @@ import (
|
|||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
const Cardslimit = 8
|
||||
|
||||
func min(a, b int) int {
|
||||
if a < b {
|
||||
return a
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func HandleMessage(c *gin.Context) {
|
||||
var req MessageRequest
|
||||
_ = c.BindJSON(&req)
|
||||
|
|
@ -57,8 +48,6 @@ func handleSearch(req *MessageRequest) {
|
|||
log.Printf("[error] Could not find SCG prices. Message: %s card name: %s", err.Error(), cardName)
|
||||
return
|
||||
}
|
||||
elements := min(Cardslimit, len(prices))
|
||||
prices = prices[:elements]
|
||||
priceInfo := cardsinfo.FormatCardPrices(cardName, prices)
|
||||
Message(req.Object.UserId, priceInfo)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue