Increase limits from 1024 to 4096

This commit is contained in:
rxdn 2022-04-06 22:21:29 +01:00
parent 0cdd832273
commit 0864213c68
2 changed files with 6 additions and 6 deletions

View File

@ -148,8 +148,8 @@ func (d *multiPanelCreateData) validateTitle() (err error) {
} }
func (d *multiPanelCreateData) validateContent() (err error) { func (d *multiPanelCreateData) validateContent() (err error) {
if len(d.Content) > 1024 { if len(d.Content) > 4096 {
err = errors.New("Embed content must be between 1 and 1024 characters") err = errors.New("Embed content must be between 1 and 4096 characters")
} else if len(d.Content) == 0 { // Fill default } else if len(d.Content) == 0 { // Fill default
d.Content = "Click on the button corresponding to the type of ticket you wish to open" d.Content = "Click on the button corresponding to the type of ticket you wish to open"
} }

View File

@ -254,7 +254,7 @@ func (p *panelBody) doValidations(ctx *gin.Context, guildId uint64) bool {
if !p.verifyContent() { if !p.verifyContent() {
ctx.AbortWithStatusJSON(400, gin.H{ ctx.AbortWithStatusJSON(400, gin.H{
"success": false, "success": false,
"error": "Panel content must be between 1 - 1024 characters in length", "error": "Panel content must be between 1 - 4096 characters in length",
}) })
return false return false
} }
@ -291,7 +291,7 @@ func (p *panelBody) doValidations(ctx *gin.Context, guildId uint64) bool {
if !p.verifyWelcomeMessage() { if !p.verifyWelcomeMessage() {
ctx.AbortWithStatusJSON(400, gin.H{ ctx.AbortWithStatusJSON(400, gin.H{
"success": false, "success": false,
"error": "Welcome message must be null or between 1 - 1024 characters", "error": "Welcome message must be blank or between 1 - 4096 characters",
}) })
return false return false
} }
@ -339,7 +339,7 @@ func (p *panelBody) verifyTitle() bool {
} }
func (p *panelBody) verifyContent() bool { func (p *panelBody) verifyContent() bool {
if len(p.Content) > 1024 { if len(p.Content) > 4096 {
return false return false
} else if len(p.Content) == 0 { // Fill default } else if len(p.Content) == 0 { // Fill default
p.Content = "By clicking the button, a ticket will be opened for you." p.Content = "By clicking the button, a ticket will be opened for you."
@ -381,7 +381,7 @@ func (p *panelBody) verifyCategory(channels []channel.Channel) bool {
} }
func (p *panelBody) verifyWelcomeMessage() bool { func (p *panelBody) verifyWelcomeMessage() bool {
return p.WelcomeMessage == nil || (len(*p.WelcomeMessage) > 0 && len(*p.WelcomeMessage) < 1025) return p.WelcomeMessage == nil || (len(*p.WelcomeMessage) > 0 && len(*p.WelcomeMessage) <= 4096)
} }
func (p *panelBody) verifyImageUrl() bool { func (p *panelBody) verifyImageUrl() bool {