diff --git a/dbot/slash_handler/setting_ui.go b/dbot/slash_handler/setting_ui.go index 4f33a8f..3a4587e 100644 --- a/dbot/slash_handler/setting_ui.go +++ b/dbot/slash_handler/setting_ui.go @@ -45,13 +45,13 @@ func (shdl SlashHandler) BuildSettingUiComponent(opt *user.StableConfig, i *disc CustomID: shdl.GetDiscordUserCustomId("setting_ui", "ban", i), Label: "Ban", Style: discordgo.DangerButton, - Emoji: discordgo.ComponentEmoji{Name: "🔒"}, + Emoji: &discordgo.ComponentEmoji{Name: "🔒"}, }, discordgo.Button{ CustomID: shdl.GetDiscordUserCustomId("setting_ui", "unban", i), Label: "Unban", Style: discordgo.SuccessButton, - Emoji: discordgo.ComponentEmoji{Name: "🔓"}, + Emoji: &discordgo.ComponentEmoji{Name: "🔓"}, }, }, } @@ -89,31 +89,31 @@ func (shdl SlashHandler) BuildSettingUiComponent(opt *user.StableConfig, i *disc CustomID: shdl.GetDiscordUserCustomId("setting_ui", "set_size", i), Label: "Set Image size", Style: discordgo.PrimaryButton, - Emoji: discordgo.ComponentEmoji{Name: "📐"}, + Emoji: &discordgo.ComponentEmoji{Name: "📐"}, }, discordgo.Button{ CustomID: shdl.GetDiscordUserCustomId("setting_ui", "set_steps", i), Label: "Set Steps", Style: discordgo.PrimaryButton, - Emoji: discordgo.ComponentEmoji{Name: "🔢"}, + Emoji: &discordgo.ComponentEmoji{Name: "🔢"}, }, discordgo.Button{ CustomID: shdl.GetDiscordUserCustomId("setting_ui", "set_cfg_scale", i), Label: "Set Cfg Scale", Style: discordgo.PrimaryButton, - Emoji: discordgo.ComponentEmoji{Name: "📏"}, + Emoji: &discordgo.ComponentEmoji{Name: "📏"}, }, discordgo.Button{ CustomID: shdl.GetDiscordUserCustomId("setting_ui", "set_negative_prompt", i), Label: "Set Negative Prompt", Style: discordgo.PrimaryButton, - Emoji: discordgo.ComponentEmoji{Name: "🚫"}, + Emoji: &discordgo.ComponentEmoji{Name: "🚫"}, }, discordgo.Button{ CustomID: shdl.GetDiscordUserCustomId("setting_ui", "set_clip_skip", i), Label: "Clip Skip", Style: discordgo.PrimaryButton, - Emoji: discordgo.ComponentEmoji{Name: "📌"}, + Emoji: &discordgo.ComponentEmoji{Name: "📌"}, }, }, }, diff --git a/dbot/slash_handler/txt2img.go b/dbot/slash_handler/txt2img.go index 45576d2..ab0ac32 100644 --- a/dbot/slash_handler/txt2img.go +++ b/dbot/slash_handler/txt2img.go @@ -3,7 +3,7 @@ * @Date: 2023-08-22 17:13:19 * @version: * @LastEditors: SpenserCai - * @LastEditTime: 2023-10-15 11:33:25 + * @LastEditTime: 2024-03-13 15:59:37 * @Description: file content */ package slash_handler @@ -310,7 +310,7 @@ func (shdl SlashHandler) BuildTxt2imgComponent(i *discordgo.InteractionCreate, i CustomID: "txt2img|retry", Label: "Retry", Style: discordgo.SecondaryButton, - Emoji: discordgo.ComponentEmoji{Name: "🔄"}, + Emoji: &discordgo.ComponentEmoji{Name: "🔄"}, Disabled: func() bool { return !global.Config.UserCenter.Enable }(), @@ -319,7 +319,7 @@ func (shdl SlashHandler) BuildTxt2imgComponent(i *discordgo.InteractionCreate, i CustomID: "txt2img|delete|" + shdl.GetDiscordUserId(i), Label: "Delete", Style: discordgo.SecondaryButton, - Emoji: discordgo.ComponentEmoji{Name: "🗑️"}, + Emoji: &discordgo.ComponentEmoji{Name: "🗑️"}, }, }, }, @@ -333,7 +333,7 @@ func (shdl SlashHandler) BuildTxt2imgComponent(i *discordgo.InteractionCreate, i CustomID: fmt.Sprintf("txt2img|multi_image|%d", j), Label: fmt.Sprintf("%d", j+1), Style: discordgo.SecondaryButton, - Emoji: discordgo.ComponentEmoji{Name: "🖼️"}, + Emoji: &discordgo.ComponentEmoji{Name: "🖼️"}, Disabled: func() bool { return !global.Config.UserCenter.Enable }(), diff --git a/go.mod b/go.mod index 7f57531..8320826 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/SpenserCai/sd-webui-go v0.4.3 github.com/buckket/go-blurhash v1.1.0 - github.com/bwmarrin/discordgo v0.27.1 + github.com/bwmarrin/discordgo v0.27.2-0.20240307155122-202785c50b9e github.com/go-openapi/errors v0.20.4 github.com/go-openapi/loads v0.21.2 github.com/go-openapi/runtime v0.26.0 @@ -16,9 +16,9 @@ require ( github.com/golang-jwt/jwt/v5 v5.0.0 github.com/jessevdk/go-flags v1.5.0 golang.org/x/image v0.12.0 - golang.org/x/net v0.15.0 + golang.org/x/net v0.22.0 golang.org/x/oauth2 v0.12.0 - golang.org/x/text v0.13.0 + golang.org/x/text v0.14.0 gorm.io/driver/mysql v1.5.1 gorm.io/driver/sqlite v1.5.3 gorm.io/gorm v1.25.4 @@ -34,7 +34,7 @@ require ( github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-sql-driver/mysql v1.7.0 // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/gorilla/websocket v1.4.2 // indirect + github.com/gorilla/websocket v1.5.1 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.5 // indirect github.com/josharian/intern v1.0.0 // indirect @@ -48,8 +48,8 @@ require ( go.opentelemetry.io/otel v1.17.0 // indirect go.opentelemetry.io/otel/metric v1.17.0 // indirect go.opentelemetry.io/otel/trace v1.17.0 // indirect - golang.org/x/crypto v0.13.0 // indirect - golang.org/x/sys v0.12.0 // indirect + golang.org/x/crypto v0.21.0 // indirect + golang.org/x/sys v0.18.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index e9c5751..aa94c71 100644 --- a/go.sum +++ b/go.sum @@ -10,6 +10,8 @@ github.com/buckket/go-blurhash v1.1.0 h1:X5M6r0LIvwdvKiUtiNcRL2YlmOfMzYobI3VCKCZ github.com/buckket/go-blurhash v1.1.0/go.mod h1:aT2iqo5W9vu9GpyoLErKfTHwgODsZp3bQfXjXJUxNb8= github.com/bwmarrin/discordgo v0.27.1 h1:ib9AIc/dom1E/fSIulrBwnez0CToJE113ZGt4HoliGY= github.com/bwmarrin/discordgo v0.27.1/go.mod h1:NJZpH+1AfhIcyQsPeuBKsUtYrRnjkyu0kIVMCHkZtRY= +github.com/bwmarrin/discordgo v0.27.2-0.20240307155122-202785c50b9e h1:1ylowZ3mOtmo1tfCWjOIBAGCGiA2t+aj5bbOOnVQ3+o= +github.com/bwmarrin/discordgo v0.27.2-0.20240307155122-202785c50b9e/go.mod h1:NJZpH+1AfhIcyQsPeuBKsUtYrRnjkyu0kIVMCHkZtRY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -101,6 +103,8 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= +github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= @@ -201,6 +205,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/image v0.12.0 h1:w13vZbU4o5rKOFFR8y7M+c4A5jXDC0uXTdHYRP8X2DQ= golang.org/x/image v0.12.0/go.mod h1:Lu90jvHG7GfemOIcldsh9A2hS01ocl6oNO7ype5mEnk= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= @@ -216,6 +222,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= +golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4= golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -242,6 +250,8 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= @@ -255,6 +265,8 @@ golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=