yagpdb icon indicating copy to clipboard operation
yagpdb copied to clipboard

[WIP] Add min and max value for slash commands validation

Open ankurp-bst opened this issue 2 years ago • 1 comments

This PR:

  1. Adds MinValue and MaxValue fields in ArgDef struct.
  2. Adds min and max value validations for slash commands.

ankurp-bst avatar Jun 24 '22 09:06 ankurp-bst

You can also do that in place if needed:


type foo struct {
	bar *float64
}

foobar := foo{func(in float64) *float64 { return &in }(10)}

But perhaps the generic approach is the best one indeed.

Maybe someday this will be a thing: https://github.com/golang/go/issues/45624

phenpessoa avatar Jun 24 '22 15:06 phenpessoa