Skip to content

Commit

Permalink
fix controlnet_detect's weight can more than 2 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
SpenserCai committed Nov 1, 2023
1 parent c772ee3 commit 21bd72a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion dbot/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @Date: 2023-08-16 22:02:04
* @version:
* @LastEditors: SpenserCai
* @LastEditTime: 2023-11-01 10:20:30
* @LastEditTime: 2023-11-01 12:25:22
* @Description: file content
*/
package dbot
Expand Down Expand Up @@ -197,6 +197,11 @@ func (dbot *DiscordBot) CommandNeedsUpdate(command *discordgo.ApplicationCommand
}

}

// if min/max values are different
if option.MinValue != registeredCommand.Options[i].MinValue || option.MaxValue != registeredCommand.Options[i].MaxValue {
return true
}
// no new choices
}
// no new options or no options
Expand Down
4 changes: 3 additions & 1 deletion dbot/slash_handler/controlnet_detect.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @Date: 2023-08-20 12:45:58
* @version:
* @LastEditors: SpenserCai
* @LastEditTime: 2023-09-23 17:19:16
* @LastEditTime: 2023-11-01 12:22:34
* @Description: file content
*/

Expand Down Expand Up @@ -124,6 +124,8 @@ func (shdl SlashHandler) ControlnetDetectOptions() *discordgo.ApplicationCommand
Name: "weight",
Description: "The weight of the module. Default: 1.0",
Required: false,
MinValue: func() *float64 { v := float64(0.0); return &v }(),
MaxValue: 2.0,
},
{
Type: discordgo.ApplicationCommandOptionInteger,
Expand Down

0 comments on commit 21bd72a

Please sign in to comment.