slash_handler

package
v1.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

* @Author: SpenserCai * @Date: 2023-08-17 09:52:25 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-10-14 13:45:26 * @Description: file content

* @Author: SpenserCai * @Date: 2023-09-24 18:25:37 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-11-01 10:21:21 * @Description: file content

* @Author: SpenserCai * @Date: 2023-08-16 22:27:15 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-10-07 23:38:13 * @Description: file content

* @Author: SpenserCai * @Date: 2023-08-19 16:21:45 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-09-23 17:17:29 * @Description: file content

* @Author: SpenserCai * @Date: 2023-08-22 13:10:36 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-08-22 13:12:54 * @Description: file content

* @Author: SpenserCai * @Date: 2023-10-13 11:33:20 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-11-01 10:03:32 * @Description: file content

* @Author: SpenserCai * @Date: 2023-08-19 18:27:34 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-09-23 17:14:45 * @Description: file content

* @Author: SpenserCai * @Date: 2023-08-31 13:51:37 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-09-23 17:13:01 * @Description: file content

* @Author: SpenserCai * @Date: 2023-08-18 11:11:48 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-09-23 17:11:39 * @Description: file content

* @Author: SpenserCai * @Date: 2023-08-22 12:58:13 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-11-03 13:00:34 * @Description: file content

* @Author: SpenserCai * @Date: 2023-08-16 22:27:32 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-09-27 22:59:10 * @Description: file content

* @Author: SpenserCai * @Date: 2023-08-31 14:59:27 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-09-29 12:14:11 * @Description: file content

* @Author: SpenserCai * @Date: 2023-09-21 16:27:24 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-09-29 11:58:06 * @Description: file content

* @Author: SpenserCai * @Date: 2023-08-22 17:13:19 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2024-03-13 15:59:37 * @Description: file content

* @Author: SpenserCai * @Date: 2023-09-26 23:24:02 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-09-27 00:58:39 * @Description: file content

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLoraListPageSize added in v1.4.5

func GetLoraListPageSize() int

Types

type SlashHandler

type SlashHandler struct{}

func (SlashHandler) BuildLoraListComponent added in v1.4.5

func (shdl SlashHandler) BuildLoraListComponent(currentPage int, pageSize int, totalPage int) *[]discordgo.MessageComponent

func (SlashHandler) BuildSettingUiComponent added in v0.7.5

func (shdl SlashHandler) BuildSettingUiComponent(opt *user.StableConfig, i *discordgo.InteractionCreate) *[]discordgo.MessageComponent

func (SlashHandler) BuildTxt2imgComponent added in v0.8.4

func (shdl SlashHandler) BuildTxt2imgComponent(i *discordgo.InteractionCreate, imgCount int64) *[]discordgo.MessageComponent

func (SlashHandler) ClusterStatusAction added in v0.9.1

func (shdl SlashHandler) ClusterStatusAction(s *discordgo.Session, i *discordgo.InteractionCreate)

func (SlashHandler) ClusterStatusCommandHandler added in v0.9.1

func (shdl SlashHandler) ClusterStatusCommandHandler(s *discordgo.Session, i *discordgo.InteractionCreate)

func (SlashHandler) ClusterStatusOptions added in v0.9.1

func (shdl SlashHandler) ClusterStatusOptions() *discordgo.ApplicationCommand

func (SlashHandler) ControlnetArgJsonGen added in v0.2.2

func (shdl SlashHandler) ControlnetArgJsonGen(dsOpt []*discordgo.ApplicationCommandInteractionDataOption) string

func (SlashHandler) ControlnetDetectAction added in v0.1.5

func (SlashHandler) ControlnetDetectCommandHandler added in v0.1.5

func (shdl SlashHandler) ControlnetDetectCommandHandler(s *discordgo.Session, i *discordgo.InteractionCreate)

func (SlashHandler) ControlnetDetectOptions added in v0.1.5

func (shdl SlashHandler) ControlnetDetectOptions() *discordgo.ApplicationCommand

func (SlashHandler) ControlnetDetectSetOptions added in v0.1.5

func (shdl SlashHandler) ControlnetDetectSetOptions(dsOpt []*discordgo.ApplicationCommandInteractionDataOption, opt *intersvc.ControlnetDetectRequest)

func (SlashHandler) ControlnetModelChoice added in v0.2.4

func (shdl SlashHandler) ControlnetModelChoice() []*discordgo.ApplicationCommandOptionChoice

func (SlashHandler) ControlnetModuleChoice added in v0.2.4

func (shdl SlashHandler) ControlnetModuleChoice() []*discordgo.ApplicationCommandOptionChoice

func (SlashHandler) ConvertCommandOptionChoiceToMenuOption added in v0.7.5

func (shdl SlashHandler) ConvertCommandOptionChoiceToMenuOption(choices []*discordgo.ApplicationCommandOptionChoice, default_v string) []discordgo.SelectMenuOption

func (SlashHandler) ConvertInteractionToUserInfo added in v0.4.2

func (shdl SlashHandler) ConvertInteractionToUserInfo(i *discordgo.InteractionCreate) *user.UserInfo

func (SlashHandler) DeleteHistory added in v1.0.1

func (shdl SlashHandler) DeleteHistory(messageId string, userId string)

func (SlashHandler) DeoldifyAction

func (SlashHandler) DeoldifyCommandHandler

func (shdl SlashHandler) DeoldifyCommandHandler(s *discordgo.Session, i *discordgo.InteractionCreate)

func (SlashHandler) DeoldifyOptions

func (shdl SlashHandler) DeoldifyOptions() *discordgo.ApplicationCommand

func (SlashHandler) DeoldifySetOptions

func (SlashHandler) ExtraSingleAction added in v0.1.4

func (SlashHandler) ExtraSingleCommandHandler added in v0.1.4

func (shdl SlashHandler) ExtraSingleCommandHandler(s *discordgo.Session, i *discordgo.InteractionCreate)

func (SlashHandler) ExtraSingleOptions added in v0.1.4

func (shdl SlashHandler) ExtraSingleOptions() *discordgo.ApplicationCommand

func (SlashHandler) ExtraSingleSetOptions added in v0.1.4

func (SlashHandler) GenerateTaskID

func (shdl SlashHandler) GenerateTaskID(i *discordgo.InteractionCreate) string

func (SlashHandler) GetBase64ImageListBlurHash added in v1.2.4

func (shdl SlashHandler) GetBase64ImageListBlurHash(imageList []string) []string

获取图片列表的BlurHash

func (SlashHandler) GetCommandStr

func (shdl SlashHandler) GetCommandStr(i *discordgo.Interaction) string

func (SlashHandler) GetControlNetScript added in v0.2.2

func (shdl SlashHandler) GetControlNetScript(jsonStr string) (*intersvc.ControlnetPredictScript, error)

func (SlashHandler) GetCurrentPageLoraList added in v1.4.5

func (shdl SlashHandler) GetCurrentPageLoraList(currentPage int, pageSize int, loras *[]intersvc.LoraItem) string

func (SlashHandler) GetDefaultSettingFromUser added in v0.4.2

func (shdl SlashHandler) GetDefaultSettingFromUser(key string, defaultValue interface{}, i *discordgo.InteractionCreate) interface{}

func (SlashHandler) GetDiscordUserCustomId added in v0.9.4

func (shdl SlashHandler) GetDiscordUserCustomId(command string, customId string, i *discordgo.InteractionCreate) string

获取带有cmmd和用户ID的CustomID

func (SlashHandler) GetDiscordUserCustomIdWithUserId added in v0.9.4

func (shdl SlashHandler) GetDiscordUserCustomIdWithUserId(command string, customId string, userId string) string

func (SlashHandler) GetDiscordUserId added in v0.6.5

func (shdl SlashHandler) GetDiscordUserId(i *discordgo.InteractionCreate) string

func (SlashHandler) GetHistory added in v0.8.4

func (shdl SlashHandler) GetHistory(command string, messageId string, opt any) error

func (SlashHandler) GetSdDefaultSetting added in v0.3.0

func (shdl SlashHandler) GetSdDefaultSetting(key string, defaultValue interface{}) interface{}

Only Step 1,will be change to support every user every setting

func (SlashHandler) GetUserCommandOptionChoice added in v0.9.4

func (shdl SlashHandler) GetUserCommandOptionChoice(i *discordgo.InteractionCreate) []*discordgo.ApplicationCommandOptionChoice

获取用户Choice

func (SlashHandler) GetUserInfoWithInteraction added in v0.4.2

func (shdl SlashHandler) GetUserInfoWithInteraction(i *discordgo.InteractionCreate) (*user.UserInfo, error)

func (SlashHandler) Img2imgAction added in v0.5.3

func (SlashHandler) Img2imgCommandHandler added in v0.5.3

func (shdl SlashHandler) Img2imgCommandHandler(s *discordgo.Session, i *discordgo.InteractionCreate)

func (SlashHandler) Img2imgOptions added in v0.5.3

func (shdl SlashHandler) Img2imgOptions() *discordgo.ApplicationCommand

func (SlashHandler) Img2imgSetOptions added in v0.5.3

func (SlashHandler) IsAdmin added in v1.2.0

func (shdl SlashHandler) IsAdmin(i *discordgo.InteractionCreate) bool

判断是否是管理员

func (SlashHandler) LoraListAction added in v1.2.3

func (shdl SlashHandler) LoraListAction(s *discordgo.Session, i *discordgo.InteractionCreate, node *cluster.ClusterNode)

func (SlashHandler) LoraListCommandHandler added in v1.2.3

func (shdl SlashHandler) LoraListCommandHandler(s *discordgo.Session, i *discordgo.InteractionCreate)

func (SlashHandler) LoraListComponentHandler added in v1.4.5

func (shdl SlashHandler) LoraListComponentHandler(s *discordgo.Session, i *discordgo.InteractionCreate, pageSize int)

func (SlashHandler) LoraListOptions added in v1.2.3

func (shdl SlashHandler) LoraListOptions() *discordgo.ApplicationCommand

func (SlashHandler) LoraListPageChange added in v1.4.5

func (shdl SlashHandler) LoraListPageChange(changeType string, pageSize int, s *discordgo.Session, i *discordgo.InteractionCreate)

func (SlashHandler) MessageEmbedTemplate added in v0.8.3

func (shdl SlashHandler) MessageEmbedTemplate() *discordgo.MessageEmbed

MessageEmbed模板

func (SlashHandler) PngInfoAction added in v0.1.4

func (SlashHandler) PngInfoCommandHandler added in v0.1.4

func (shdl SlashHandler) PngInfoCommandHandler(s *discordgo.Session, i *discordgo.InteractionCreate)

func (SlashHandler) PngInfoOptions added in v0.1.4

func (shdl SlashHandler) PngInfoOptions() *discordgo.ApplicationCommand

func (SlashHandler) PngInfoSetOptions added in v0.1.4

func (SlashHandler) RegisterAction added in v0.4.2

func (shdl SlashHandler) RegisterAction(s *discordgo.Session, i *discordgo.InteractionCreate, node *cluster.ClusterNode)

func (SlashHandler) RegisterCommandHandler added in v0.4.2

func (shdl SlashHandler) RegisterCommandHandler(s *discordgo.Session, i *discordgo.InteractionCreate)

func (SlashHandler) RegisterOptions added in v0.4.2

func (shdl SlashHandler) RegisterOptions() *discordgo.ApplicationCommand

func (SlashHandler) RembgAction

func (SlashHandler) RembgCommandHandler

func (shdl SlashHandler) RembgCommandHandler(s *discordgo.Session, i *discordgo.InteractionCreate)

func (SlashHandler) RembgOptions

func (shdl SlashHandler) RembgOptions() *discordgo.ApplicationCommand

func (SlashHandler) RembgSetOptions

func (SlashHandler) RespondStateMessage added in v0.8.2

func (shdl SlashHandler) RespondStateMessage(state string, s *discordgo.Session, i *discordgo.InteractionCreate) error

func (SlashHandler) RespondStateMessageWithFlag added in v0.8.2

func (shdl SlashHandler) RespondStateMessageWithFlag(state string, s *discordgo.Session, i *discordgo.InteractionCreate, flags discordgo.MessageFlags) error

func (SlashHandler) RoopImageAction added in v0.2.0

func (SlashHandler) RoopImageCommandHandler added in v0.2.0

func (shdl SlashHandler) RoopImageCommandHandler(s *discordgo.Session, i *discordgo.InteractionCreate)

func (SlashHandler) RoopImageOptions added in v0.2.0

func (shdl SlashHandler) RoopImageOptions() *discordgo.ApplicationCommand

func (SlashHandler) RoopImageSetOptions added in v0.2.0

func (SlashHandler) SamAction

func (SlashHandler) SamCommandHandler

func (shdl SlashHandler) SamCommandHandler(s *discordgo.Session, i *discordgo.InteractionCreate)

func (SlashHandler) SamOptions

func (shdl SlashHandler) SamOptions() *discordgo.ApplicationCommand

func (SlashHandler) SamSetOptions

func (shdl SlashHandler) SamSetOptions(cmd discordgo.ApplicationCommandInteractionData, opt *intersvc.SamSamPredictRequest, isReturnMask *bool)

func (SlashHandler) SamplerChoice added in v0.4.3

func (shdl SlashHandler) SamplerChoice() []*discordgo.ApplicationCommandOptionChoice

func (SlashHandler) SdModelChoice added in v0.3.2

func (shdl SlashHandler) SdModelChoice() []*discordgo.ApplicationCommandOptionChoice

func (SlashHandler) SdVaeChoice added in v0.7.1

func (SlashHandler) SendStateMessage

func (shdl SlashHandler) SendStateMessage(state string, s *discordgo.Session, i *discordgo.InteractionCreate) (*discordgo.Message, error)

func (SlashHandler) SendStateMessageWithFlag added in v0.7.5

func (shdl SlashHandler) SendStateMessageWithFlag(state string, s *discordgo.Session, i *discordgo.InteractionCreate, flags discordgo.MessageFlags) (*discordgo.Message, error)

func (SlashHandler) SendTextInteractionRespondWithFlag added in v0.8.0

func (shdl SlashHandler) SendTextInteractionRespondWithFlag(msg string, s *discordgo.Session, i *discordgo.InteractionCreate, flags discordgo.MessageFlags) error

func (SlashHandler) SetDiscordUserId added in v0.9.4

func (shdl SlashHandler) SetDiscordUserId(i *discordgo.InteractionCreate, userId string)

func (SlashHandler) SetHistory added in v0.8.4

func (shdl SlashHandler) SetHistory(command string, messageId string, i *discordgo.InteractionCreate, opt any)

func (SlashHandler) SetHistoryImages added in v0.10.3

func (shdl SlashHandler) SetHistoryImages(messageId string, i *discordgo.InteractionCreate, images []string, imagesBlurHash []string)

func (SlashHandler) SettingAction added in v0.4.2

func (SlashHandler) SettingCommandHandler added in v0.4.2

func (shdl SlashHandler) SettingCommandHandler(s *discordgo.Session, i *discordgo.InteractionCreate)

func (SlashHandler) SettingOptions added in v0.4.2

func (shdl SlashHandler) SettingOptions() *discordgo.ApplicationCommand

func (SlashHandler) SettingSetOptions added in v0.4.2

func (shdl SlashHandler) SettingSetOptions(dsOpt []*discordgo.ApplicationCommandInteractionDataOption, opt *user.StableConfig)

func (SlashHandler) SettingUiAction added in v0.7.5

func (shdl SlashHandler) SettingUiAction(s *discordgo.Session, i *discordgo.InteractionCreate, node *cluster.ClusterNode)

func (SlashHandler) SettingUiCommandHandler added in v0.7.5

func (shdl SlashHandler) SettingUiCommandHandler(s *discordgo.Session, i *discordgo.InteractionCreate)

func (SlashHandler) SettingUiComponentHandler added in v0.8.0

func (shdl SlashHandler) SettingUiComponentHandler(s *discordgo.Session, i *discordgo.InteractionCreate, userInfo *user.UserInfo) (isFinish bool)

func (SlashHandler) SettingUiModalSubmitHander added in v0.8.0

func (shdl SlashHandler) SettingUiModalSubmitHander(s *discordgo.Session, i *discordgo.InteractionCreate, userInfo *user.UserInfo) (isSuccess bool)

func (SlashHandler) SettingUiOptions added in v0.7.5

func (shdl SlashHandler) SettingUiOptions() *discordgo.ApplicationCommand

func (SlashHandler) SettingUiSetOptions added in v0.7.5

func (shdl SlashHandler) SettingUiSetOptions(dsOpt []*discordgo.ApplicationCommandInteractionDataOption, opt *user.StableConfig)

func (SlashHandler) Txt2imgAction added in v0.2.1

func (SlashHandler) Txt2imgAppHandler added in v0.8.4

func (shdl SlashHandler) Txt2imgAppHandler(s *discordgo.Session, i *discordgo.InteractionCreate, otherOption *intersvc.SdapiV1Txt2imgRequest, useOtherOption bool)

func (SlashHandler) Txt2imgCommandHandler added in v0.2.1

func (shdl SlashHandler) Txt2imgCommandHandler(s *discordgo.Session, i *discordgo.InteractionCreate)

func (SlashHandler) Txt2imgComponentHandler added in v0.8.4

func (shdl SlashHandler) Txt2imgComponentHandler(s *discordgo.Session, i *discordgo.InteractionCreate)

func (SlashHandler) Txt2imgOptions added in v0.2.1

func (shdl SlashHandler) Txt2imgOptions() *discordgo.ApplicationCommand

func (SlashHandler) Txt2imgSetOptions added in v0.2.1

func (SlashHandler) UserInfoAction added in v0.9.4

func (shdl SlashHandler) UserInfoAction(s *discordgo.Session, i *discordgo.InteractionCreate, uId *string, node *cluster.ClusterNode)

TODO: 由于所有的组件和modal的id都是固定了命令的,所以需要实现id中的命令是动态的,同时由于参数中的用户id无法传递到按钮上所以需要在最开始设置按钮的时候就把id带到按钮的组件id中

func (SlashHandler) UserInfoCommandHandler added in v0.9.4

func (shdl SlashHandler) UserInfoCommandHandler(s *discordgo.Session, i *discordgo.InteractionCreate)

func (SlashHandler) UserInfoOptions added in v0.9.4

func (shdl SlashHandler) UserInfoOptions() *discordgo.ApplicationCommand

func (SlashHandler) UserInfoSetOptions added in v0.9.4

func (shdl SlashHandler) UserInfoSetOptions(dsOpt []*discordgo.ApplicationCommandInteractionDataOption, s *discordgo.Session, uId *string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL