Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CNPJCommand = command.Command{ Name: "cnpj", Handler: func(ctx *command.Context) command.Result { t := ctx.T.(*i18n.CommandCNPJ) cnpj := doc.GenerateCNPJ() components := cnpjMaskRe.FindStringSubmatch(cnpj) maskedCNPJ := fmt.Sprintf( "%s.%s.%s/%s-%s", components[1], components[2], components[3], components[4], components[5], ) return ctx.SuccessEmbed( model.NewEmbed(). WithTitle(t.Title.Str()). WithField(t.WithoutMask.Str(), cnpj). WithField(t.WithMask.Str(), maskedCNPJ), ) }, }
View Source
var CPFCommand = command.Command{ Name: "cpf", Handler: func(ctx *command.Context) command.Result { t := ctx.T.(*i18n.CommandCPF) cpf := doc.GenerateCPF() components := cpfMaskRe.FindStringSubmatch(cpf) maskedCPF := fmt.Sprintf( "%s.%s.%s-%s", components[1], components[2], components[3], components[4], ) return ctx.SuccessEmbed( model.NewEmbed(). WithTitle(t.Title.Str()). WithField(t.WithoutMask.Str(), cpf). WithField(t.WithMask.Str(), maskedCPF), ) }, }
View Source
var PasswordCommand = command.Command{ Name: "password", Aliases: []string{"pass"}, Ephemeral: true, Parameters: []*command.Parameter{ {Name: "length", Type: parameters.ParameterInt, Required: false}, }, Handler: func(ctx *command.Context) command.Result { t := ctx.T.(*i18n.CommandPassword) length := 10 if len(ctx.Args) == 1 { length = ctx.Args[0].(int) } password, err := generatePassword(length) if err != nil { slog.Error("Cannot generate password", tint.Err(err)) return ctx.Error(ctx.Lang.SomethingWentWrong.Str()) } embed := model.NewEmbed(). WithTitle(t.Title.Str()). WithDescription( t.Description.Str( length, password, ), ) return ctx.SuccessEmbed(embed) }, }
View Source
var Tools = command.Category{ Name: "tools", Emoji: "🔧", Commands: []*command.Command{ &UUIDCommand, &CPFCommand, &CNPJCommand, &PasswordCommand, }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.