Unverified Commit 2ecfd7b0 authored by Kevin Lyda's avatar Kevin Lyda
Browse files

Gatekeep those new SET commands

parent 59351d54
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -69,6 +69,9 @@ func ActionSetNobrief(_ *dclish.Command) error {

// ActionSetDefaultExpire handles the `SET DEFAULT_EXPIRE` command.
func ActionSetDefaultExpire(cmd *dclish.Command) error {
	if this.User.Admin == 0 {
		return errors.New("You are not an admin")
	}
	value, err := strconv.ParseInt(cmd.Args[0], 10, 64)
	if err != nil {
		return err
@@ -79,7 +82,9 @@ func ActionSetDefaultExpire(cmd *dclish.Command) error {

// ActionSetExpireLimit handles the `SET EXPIRE_LIMIT` command.
func ActionSetExpireLimit(cmd *dclish.Command) error {
	fmt.Println("TODO: implement ActionSetExpireLimit.")
	if this.User.Admin == 0 {
		return errors.New("You are not an admin")
	}
	value, err := strconv.ParseInt(cmd.Args[0], 10, 64)
	if err != nil {
		return err