welcomer

package module
v0.0.0-...-5f41dac Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: AGPL-3.0 Imports: 29 Imported by: 2

Documentation

Overview

* Written in 2019 by Andrew Ayer * * To the extent possible under law, the author(s) have dedicated all * copyright and related and neighboring rights to this software to the * public domain worldwide. This software is distributed without any * warranty. * * You should have received a copy of the CC0 Public * Domain Dedication along with this software. If not, see * <https://creativecommons.org/publicdomain/zero/1.0/>.

Index

Constants

View Source
const (
	EmojiCheck   = "<:check:1196902761627914402>"
	EmojiCross   = "<:cross:1196902764048031744>"
	EmojiNeutral = "<:neutral:1196903241959620730>"

	EmojiRock = "<:rock:732274836038221855>"
)
View Source
const (
	EmbedColourInfo    = 0x2F80ED
	EmbedColourSuccess = 0x4CD787
	EmbedColourError   = 0xFC6A70
	EmbedColourWarn    = 0xFBC01B
)
View Source
const (
	CustomEventInvokeWelcomer = "WELCOMER_INVOKE_WELCOMER"
	CustomEventInvokeLeaver   = "WELCOMER_INVOKE_LEAVER"

	CustomEventInvokeTempChannels       = "WELCOMER_INVOKE_TEMPCHANNELS"
	CustomEventInvokeTempChannelsRemove = "WELCOMER_INVOKE_TEMPCHANNELS_REMOVE"

	CustomEventInvokeBorderwall           = "WELCOMER_INVOKE_BORDERWALL"
	CustomEventInvokeBorderwallCompletion = "WELCOMER_INVOKE_BORDERWALL_COMPLETION"
)
View Source
const (
	IPIntelFlagDefaultLookup               IPIntelFlags = ""
	IPIntelFlagDynamicBanList              IPIntelFlags = "m"
	IPIntelFlagDynamicBanListDynamicChecks IPIntelFlags = "b"
	IPIntelFlagForceFullLookup             IPIntelFlags = "f"

	IPIntelOFlagOnlyBadIP   IPIntelOFlags = "b"
	IPIntelOFlagShowCountry IPIntelOFlags = "c"
	IPIntelOFlagShowVPN     IPIntelOFlags = "i"
	IPIntelOFlgagShowASN    IPIntelOFlags = "a"
)
View Source
const (
	IPIntelEndpoint = "https://check.getipintel.net/check.php"
)
View Source
const (
	RecaptchaEndpoint = "https://www.google.com/recaptcha/api/siteverify"
)
View Source
const (
	UserAgent = "WelcomerService (https://github.com/WelcomerTeam/Welcomer)"
)

Variables

View Source
var (
	EmojiMessageBadge = discord.Emoji{ID: 987044175943970867, Name: "messagebadge"}
	EmojiShieldAlert  = discord.Emoji{ID: 987044177160331322, Name: "shieldalert"}
	EmojiCheckMark    = discord.Emoji{ID: 586907765662941185, Name: "checkboxmarkedoutline"}

	SupportInvite = "https://discord.gg/kQJz33ExK2"
	WebsiteURL    = "https://welcomer.gg"
)
View Source
var (
	ErrInvalidJSON       = fmt.Errorf("invalid json")
	ErrInvalidColour     = fmt.Errorf("colour format is not recognised")
	ErrInvalidBackground = fmt.Errorf("invalid background")

	ErrMissingChannel         = fmt.Errorf("missing channel")
	ErrMissingApplicationUser = fmt.Errorf("missing application user")
)
View Source
var (
	CustomBackgroundPrefix = "custom:"
	SolidColourPrefix      = "solid:"
	SolidColourPrefixBased = "profile"
	UnsplashPrefix         = "unsplash:"

	RGBAPrefix = "rgba"
	RGBPrefix  = "rgb"

	RGBRegex  = regexp.MustCompile(`^rgb\(([0-9]+)(\w+)?, ([0-9]+)(\w+)?, ([0-9]+)(\w+)?\)$`)
	RGBARegex = regexp.MustCompile(`^rgba\(([0-9]+)(\w+)?, ([0-9]+)(\w+)?, ([0-9].+)(\w+)?\)$`)
)
View Source
var (
	True  = true
	False = false
)
View Source
var CountryMapping = map[string]Currency{
	"IN": CurrencyINR,
}
View Source
var SKUPricing = map[SKUName]PricingSKU{
	SKUCustomBackgrounds: {
		ID:             SKUCustomBackgrounds,
		Name:           "Custom Backgrounds",
		Description:    "One-time purchase to unlock custom welcome backgrounds for your server.",
		MembershipType: database.MembershipTypeCustomBackgrounds,
		SoftDescriptor: "Backgrounds",
		MonthCount:     -1,
		Costs: map[Currency]string{
			CurrencyEUR: "12.00",
			CurrencyGBP: "10.00",
			CurrencyUSD: "12.00",
			CurrencyINR: "300",
		},
	},
	SKUWelcomerPro: {
		ID:             SKUWelcomerPro,
		Name:           "Welcomer Pro",
		Description:    "Unlock all Welcomer Pro features for your server.",
		MembershipType: database.MembershipTypeWelcomerPro,
		SoftDescriptor: "Pro",
		MonthCount:     1,
		Costs: map[Currency]string{
			CurrencyEUR: "8.00",
			CurrencyGBP: "7.00",
			CurrencyUSD: "8.00",
			CurrencyINR: "300",
		},
	},
	SKUWelcomerProBiAnnual: {
		ID:             SKUWelcomerProBiAnnual,
		Name:           "Welcomer Pro",
		Description:    "Unlock all Welcomer Pro features for your server.",
		MembershipType: database.MembershipTypeWelcomerPro,
		SoftDescriptor: "Pro",
		MonthCount:     6,
		Costs: map[Currency]string{
			CurrencyEUR: "40.00",
			CurrencyGBP: "35.00",
			CurrencyUSD: "40.00",
			CurrencyINR: "1500",
		},
	},
	SKUWelcomerProAnnual: {
		ID:             SKUWelcomerProAnnual,
		Name:           "Welcomer Pro",
		Description:    "Unlock all Welcomer Pro features for your server.",
		MembershipType: database.MembershipTypeWelcomerPro,
		SoftDescriptor: "Pro",
		MonthCount:     12,
		Costs: map[Currency]string{
			CurrencyEUR: "80.00",
			CurrencyGBP: "70.00",
			CurrencyUSD: "80.00",
			CurrencyINR: "3000",
		},
	},
}

Functions

func AcquireSession

func AcquireSession(ctx context.Context, sub *subway.Subway, managerName string) (session *discord.Session, err error)

func AddManagerNameToContext

func AddManagerNameToContext(ctx context.Context, v string) context.Context

ManagerName context handler.

func AddPoolToContext

func AddPoolToContext(ctx context.Context, v *pgxpool.Pool) context.Context

Arguments context handler.

func AddQueriesToContext

func AddQueriesToContext(ctx context.Context, v *database.Queries) context.Context

Queries context handler.

func AssertLength

func AssertLength(name string, expectedLength int, arguments ...interface{}) (err error)

func Atoi

func Atoi(s string) (int64, error)

func CheckGuildMemberships

func CheckGuildMemberships(memberships []*database.GetUserMembershipsByGuildIDRow) (hasWelcomerPro bool, hasCustomBackgrounds bool)

func ConvertToRGBA

func ConvertToRGBA(int32Color int64) color.RGBA

func FilterAssignableRoles

func FilterAssignableRoles(ctx context.Context, sandwichClient protobuf.SandwichClient, logger zerolog.Logger, guildID int64, applicationID int64, roleIDs []int64) (out []discord.Snowflake, err error)

func FormatString

func FormatString(funcs map[string]govaluate.ExpressionFunction, vars map[string]interface{}, message string) (string, error)

func FormatTextStroke

func FormatTextStroke(v bool) int

func GatherFunctions

func GatherFunctions() (funcs map[string]govaluate.ExpressionFunction)

func GatherVariables

func GatherVariables(eventCtx *sandwich.EventContext, member discord.GuildMember, guild discord.Guild, extraValues map[string]interface{}) (vars map[string]interface{})

func GetGuildMemberDisplayName

func GetGuildMemberDisplayName(member discord.GuildMember) string

func GetManagerNameFromContext

func GetManagerNameFromContext(ctx context.Context) string

func GetPoolFromContext

func GetPoolFromContext(ctx context.Context) *pgxpool.Pool

func GetQueriesFromContext

func GetQueriesFromContext(ctx context.Context) *database.Queries

func GetUserAvatar

func GetUserAvatar(user *discord.User) string

func GetUserDisplayName

func GetUserDisplayName(user *discord.User) string

func HumanizeDuration

func HumanizeDuration(seconds int) string

func If

func If[T any](condition bool, trueValue, falseValue T) T

func IncludeBorderwallVerifyButton

func IncludeBorderwallVerifyButton(messageParams *discord.MessageParams, borderwallLink string) *discord.MessageParams

func IncludeScamsButton

func IncludeScamsButton(messageParams *discord.MessageParams) *discord.MessageParams

func IncludeSentByButton

func IncludeSentByButton(messageParams *discord.MessageParams, guildName string) *discord.MessageParams

func IsJSONBEmpty

func IsJSONBEmpty(b []byte) bool

IsJSONBEmpty checks if a byte slice is empty or is a JSON empty object.

func IsMessageParamsEmpty

func IsMessageParamsEmpty(m discord.MessageParams) bool

IsMessageParamsEmpty checks if the given message parameters are empty. It returns true if the content and all the fields in the embeds are empty, otherwise it returns false.

func IsValidBackground

func IsValidBackground(s string) bool

func IsValidColour

func IsValidColour(str string) bool

func IsValidEmbed

func IsValidEmbed(s string) bool

func IsValidHex

func IsValidHex(str string, allowAlpha bool) bool

func IsValidImageAlignment

func IsValidImageAlignment(value string) bool

func IsValidImageProfileBorderType

func IsValidImageProfileBorderType(value string) bool

func IsValidImageTheme

func IsValidImageTheme(value string) bool

func IsValidInteger

func IsValidInteger(str string) bool

func IsValidURL

func IsValidURL(url string) (*url.URL, bool)

Validates a URL and prevents SSRF.

func IsValidUnsplashID

func IsValidUnsplashID(str string) bool

func Itoa

func Itoa(v int64) string

func MarshalTimeRolesJSON

func MarshalTimeRolesJSON(roles []GuildSettingsTimeRolesRole) (rolesJSON []byte)

func MemberHasElevation

func MemberHasElevation(discordGuild *discord.Guild, member discord.GuildMember) bool

func NewEmbed

func NewEmbed(message string, color int32) []*discord.Embed

func ParseColour

func ParseColour(str string, defaultValue string) (*color.RGBA, error)

ParseColour parses a colour and returns RGBA. Expected formats: #FFAAAA #FFAAAAFF RGBA(255, 255, 255, 0.1) RGB(255, 255, 255)

func ParseUserAgent

func ParseUserAgent(userAgent string) (family, familyVersion, os, osVersion string)

func RandStringBytesRmndr

func RandStringBytesRmndr(n int) string

func RequireGuild

func RequireGuild(interaction discord.Interaction, handler BasicInteractionHandler) (*discord.InteractionResponse, error)

func RequireGuildElevation

func RequireGuildElevation(sub *subway.Subway, interaction discord.Interaction, handler BasicInteractionHandler) (*discord.InteractionResponse, error)

func SetupJSONB

func SetupJSONB(jsonb pgtype.JSONB) pgtype.JSONB

func SliceContains

func SliceContains[T comparable](slice []T, value T) bool

func StringToJsonLiteral

func StringToJsonLiteral(s string) jsoniter.RawMessage

StringToJsonLiteral converts a string to a jsoniter.RawMessage.

func ToPointer

func ToPointer[K any](k K) *K

func TryParseBool

func TryParseBool(str string) bool

func TryParseFloat

func TryParseFloat(str string) float64

func TryParseInt

func TryParseInt(str string) int

func ValidateRecaptcha

func ValidateRecaptcha(logger zerolog.Logger, response string, ipAddress string) (float64, error)

Types

type Background

type Background struct {
	Value string         `json:"value"`
	Type  BackgroundType `json:"type"`
}

func ParseBackground

func ParseBackground(str string) (Background, error)

ParseBackground parses a background string provided by user. Expected formats: solid:FFAAAA - Solid colour with HEX code. solid:profile - Solid colour based on user profile picture. unsplash:Bnr_ZSmqbDY - Unsplash along with Id. custom:018c186a-4ce5-74c7-b2d1-b0639c2f4686 - per-guild welcomer background

type BackgroundType

type BackgroundType int32

ENUM(default, welcomer, solid, solidProfile, unsplash, url)

const (
	// BackgroundTypeDefault is a BackgroundType of type Default.
	BackgroundTypeDefault BackgroundType = iota
	// BackgroundTypeWelcomer is a BackgroundType of type Welcomer.
	BackgroundTypeWelcomer
	// BackgroundTypeSolid is a BackgroundType of type Solid.
	BackgroundTypeSolid
	// BackgroundTypeSolidProfile is a BackgroundType of type SolidProfile.
	BackgroundTypeSolidProfile
	// BackgroundTypeUnsplash is a BackgroundType of type Unsplash.
	BackgroundTypeUnsplash
	// BackgroundTypeUrl is a BackgroundType of type Url.
	BackgroundTypeUrl
)

func ParseBackgroundType

func ParseBackgroundType(name string) (BackgroundType, error)

ParseBackgroundType attempts to convert a string to a BackgroundType.

func (BackgroundType) MarshalText

func (x BackgroundType) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method.

func (BackgroundType) String

func (x BackgroundType) String() string

String implements the Stringer interface.

func (*BackgroundType) UnmarshalText

func (x *BackgroundType) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method.

type BasicIPChecker

type BasicIPChecker struct {
	// contains filtered or unexported fields
}

func NewBasicIPChecker

func NewBasicIPChecker(logger zerolog.Logger) *BasicIPChecker

NewBasicIPChecker creates a new basic IP checker.

func (*BasicIPChecker) CheckIP

func (c *BasicIPChecker) CheckIP(ipaddress string, flags IPIntelFlags, oflags IPIntelOFlags) (response IPIntelResponse, err error)

type BasicInteractionHandler

type BasicInteractionHandler func() (*discord.InteractionResponse, error)

type Currency

type Currency string
const (
	CurrencyEUR Currency = "EUR"
	CurrencyGBP Currency = "GBP"
	CurrencyINR Currency = "INR"
	CurrencyUSD Currency = "USD"
)

type CustomEventInvokeBorderwallCompletionStructure

type CustomEventInvokeBorderwallCompletionStructure struct {
	Member discord.GuildMember
}

type CustomEventInvokeBorderwallStructure

type CustomEventInvokeBorderwallStructure struct {
	Member discord.GuildMember
}

type CustomEventInvokeLeaverStructure

type CustomEventInvokeLeaverStructure struct {
	Interaction *discord.Interaction
	User        discord.User
	GuildID     discord.Snowflake
}

type CustomEventInvokeTempChannelsRemoveStructure

type CustomEventInvokeTempChannelsRemoveStructure struct {
	Interaction *discord.Interaction
	Member      discord.GuildMember
}

type CustomEventInvokeTempChannelsStructure

type CustomEventInvokeTempChannelsStructure struct {
	Interaction *discord.Interaction
	Member      discord.GuildMember
}

type CustomEventInvokeWelcomerStructure

type CustomEventInvokeWelcomerStructure struct {
	Interaction *discord.Interaction
	Member      discord.GuildMember
}

type GenerateImageOptionsRaw

type GenerateImageOptionsRaw struct {
	AvatarURL          string
	Background         string
	Text               string
	TextFont           string
	TextColor          int64
	UserID             int64
	ProfileBorderColor int64
	GuildID            int64
	ImageBorderColor   int64
	TextStrokeColor    int64
	Theme              int32
	TextAlign          int32
	ImageBorderWidth   int32
	ProfileFloat       int32
	ProfileBorderWidth int32
	ProfileBorderCurve int32
	TextStroke         bool
	AllowAnimated      bool
}

type GuildSettingsTimeRolesRole

type GuildSettingsTimeRolesRole struct {
	Role    discord.Snowflake `json:"role_id"`
	Seconds int               `json:"seconds"`
}

func FilterAssignableTimeRoles

func FilterAssignableTimeRoles(ctx context.Context, sandwichClient protobuf.SandwichClient, logger zerolog.Logger, guildID int64, applicationID int64, timeRoles []GuildSettingsTimeRolesRole) (out []GuildSettingsTimeRolesRole, err error)

func UnmarshalTimeRolesJSON

func UnmarshalTimeRolesJSON(rolesJSON []byte) (roles []GuildSettingsTimeRolesRole)

type IPChecker

type IPChecker interface {
	CheckIP(ipaddress string, flags IPIntelFlags, oflags IPIntelOFlags) (response IPIntelResponse, err error)
}

type IPIntelFlags

type IPIntelFlags string

type IPIntelOFlags

type IPIntelOFlags string

type IPIntelResponse

type IPIntelResponse struct {
	Success      string  `json:"success"`
	ResultString string  `json:"result"`
	Result       float64 `json:"-"`
	Country      string  `json:"Country"`
}

type ImageAlignment

type ImageAlignment int32

ENUM(left, center, right, topLeft, topCenter, topRight, bottomLeft, bottomCenter, bottomRight)

const (
	// ImageAlignmentLeft is a ImageAlignment of type Left.
	ImageAlignmentLeft ImageAlignment = iota
	// ImageAlignmentCenter is a ImageAlignment of type Center.
	ImageAlignmentCenter
	// ImageAlignmentRight is a ImageAlignment of type Right.
	ImageAlignmentRight
	// ImageAlignmentTopLeft is a ImageAlignment of type TopLeft.
	ImageAlignmentTopLeft
	// ImageAlignmentTopCenter is a ImageAlignment of type TopCenter.
	ImageAlignmentTopCenter
	// ImageAlignmentTopRight is a ImageAlignment of type TopRight.
	ImageAlignmentTopRight
	// ImageAlignmentBottomLeft is a ImageAlignment of type BottomLeft.
	ImageAlignmentBottomLeft
	// ImageAlignmentBottomCenter is a ImageAlignment of type BottomCenter.
	ImageAlignmentBottomCenter
	// ImageAlignmentBottomRight is a ImageAlignment of type BottomRight.
	ImageAlignmentBottomRight
)

func ParseImageAlignment

func ParseImageAlignment(name string) (ImageAlignment, error)

ParseImageAlignment attempts to convert a string to a ImageAlignment.

func (ImageAlignment) MarshalText

func (x ImageAlignment) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method.

func (ImageAlignment) String

func (x ImageAlignment) String() string

String implements the Stringer interface.

func (*ImageAlignment) UnmarshalText

func (x *ImageAlignment) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method.

type ImageFileType

type ImageFileType int32

ENUM(unknown, image/png, image/jpeg, image/gif, image/webp)

const (
	// ImageFileTypeUnknown is a ImageFileType of type Unknown.
	ImageFileTypeUnknown ImageFileType = iota
	// ImageFileTypeImagePng is a ImageFileType of type Image/Png.
	ImageFileTypeImagePng
	// ImageFileTypeImageJpeg is a ImageFileType of type Image/Jpeg.
	ImageFileTypeImageJpeg
	// ImageFileTypeImageGif is a ImageFileType of type Image/Gif.
	ImageFileTypeImageGif
	// ImageFileTypeImageWebp is a ImageFileType of type Image/Webp.
	ImageFileTypeImageWebp
)

func ParseImageFileType

func ParseImageFileType(name string) (ImageFileType, error)

ParseImageFileType attempts to convert a string to a ImageFileType.

func (ImageFileType) MarshalText

func (x ImageFileType) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method.

func (ImageFileType) String

func (x ImageFileType) String() string

String implements the Stringer interface.

func (*ImageFileType) UnmarshalText

func (x *ImageFileType) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method.

type ImageProfileBorderType

type ImageProfileBorderType int32

ENUM(circular, rounded, squared, hexagonal)

const (
	// ImageProfileBorderTypeCircular is a ImageProfileBorderType of type Circular.
	ImageProfileBorderTypeCircular ImageProfileBorderType = iota
	// ImageProfileBorderTypeRounded is a ImageProfileBorderType of type Rounded.
	ImageProfileBorderTypeRounded
	// ImageProfileBorderTypeSquared is a ImageProfileBorderType of type Squared.
	ImageProfileBorderTypeSquared
	// ImageProfileBorderTypeHexagonal is a ImageProfileBorderType of type Hexagonal.
	ImageProfileBorderTypeHexagonal
)

func ParseImageProfileBorderType

func ParseImageProfileBorderType(name string) (ImageProfileBorderType, error)

ParseImageProfileBorderType attempts to convert a string to a ImageProfileBorderType.

func (ImageProfileBorderType) MarshalText

func (x ImageProfileBorderType) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method.

func (ImageProfileBorderType) String

func (x ImageProfileBorderType) String() string

String implements the Stringer interface.

func (*ImageProfileBorderType) UnmarshalText

func (x *ImageProfileBorderType) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method.

type ImageTheme

type ImageTheme int32

ENUM(default, vertical, card)

const (
	// ImageThemeDefault is a ImageTheme of type Default.
	ImageThemeDefault ImageTheme = iota
	// ImageThemeVertical is a ImageTheme of type Vertical.
	ImageThemeVertical
	// ImageThemeCard is a ImageTheme of type Card.
	ImageThemeCard
)

func ParseImageTheme

func ParseImageTheme(name string) (ImageTheme, error)

ParseImageTheme attempts to convert a string to a ImageTheme.

func (ImageTheme) MarshalText

func (x ImageTheme) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method.

func (ImageTheme) String

func (x ImageTheme) String() string

String implements the Stringer interface.

func (*ImageTheme) UnmarshalText

func (x *ImageTheme) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method.

type LRUIPChecker

type LRUIPChecker struct {
	// contains filtered or unexported fields
}

func NewLRUIPChecker

func NewLRUIPChecker(logger zerolog.Logger, maxSize int) *LRUIPChecker

NewLRUIPChecker creates a new LRU IP checker with the specified maximum cache size.

func (*LRUIPChecker) CheckIP

func (c *LRUIPChecker) CheckIP(ipaddress string, flags IPIntelFlags, oflags IPIntelOFlags) (response IPIntelResponse, err error)

type OnInvokeBorderwallCompletionFuncType

type OnInvokeBorderwallCompletionFuncType func(eventCtx *sandwich.EventContext, member CustomEventInvokeBorderwallCompletionStructure) error

type OnInvokeBorderwallFuncType

type OnInvokeBorderwallFuncType func(eventCtx *sandwich.EventContext, member CustomEventInvokeBorderwallStructure) error

type OnInvokeLeaverFuncType

type OnInvokeLeaverFuncType func(eventCtx *sandwich.EventContext, member CustomEventInvokeLeaverStructure) error

type OnInvokeTempChannelsFuncType

type OnInvokeTempChannelsFuncType func(eventCtx *sandwich.EventContext, member CustomEventInvokeTempChannelsStructure) error

type OnInvokeTempChannelsRemoveFuncType

type OnInvokeTempChannelsRemoveFuncType func(eventCtx *sandwich.EventContext, member CustomEventInvokeTempChannelsRemoveStructure) error

type OnInvokeWelcomerFuncType

type OnInvokeWelcomerFuncType func(eventCtx *sandwich.EventContext, member CustomEventInvokeWelcomerStructure) error

type PricingSKU

type PricingSKU struct {
	ID                SKUName                 `json:"id"`
	Name              string                  `json:"name"`
	Description       string                  `json:"-"`
	MembershipType    database.MembershipType `json:"-"`
	SoftDescriptor    string                  `json:"-"` // This should be 13 characters or less.
	MonthCount        int                     `json:"month_count"`
	Costs             map[Currency]string     `json:"costs"`
	PatreonCheckoutId string                  `json:"patreon_checkout_id"`
}

type RecaptchaRequest

type RecaptchaRequest struct {
	Secret    string `json:"secret"`
	Response  string `json:"response"`
	IPAddress string `json:"ip_address"`
}

type RecaptchaResponse

type RecaptchaResponse struct {
	ChallengeTimestamp time.Time `json:"challenge_ts"`
	Action             string    `json:"action"`
	Hostname           string    `json:"hostname"`
	ErrorCodes         []string  `json:"error-codes"`
	Score              float64   `json:"score"`
	Success            bool      `json:"success"`
}

type SKUName

type SKUName string
const (
	SKUCustomBackgrounds   SKUName = "WEL/CBG"
	SKUWelcomerPro         SKUName = "WEL/1P1"
	SKUWelcomerProBiAnnual SKUName = "WEL/1P6"
	SKUWelcomerProAnnual   SKUName = "WEL/1P12"
)

type StubGuild

type StubGuild struct {
	Name    string            `json:"name"`
	Icon    string            `json:"icon"`
	Splash  string            `json:"splash"`
	Banner  string            `json:"banner"`
	ID      discord.Snowflake `json:"id"`
	Members int32             `json:"members"`
}

Guild represents a guild on discord.

func (StubGuild) String

func (s StubGuild) String() string

type StubTime

type StubTime time.Time

func (StubTime) Relative

func (s StubTime) Relative() string

func (StubTime) String

func (s StubTime) String() string

type StubUser

type StubUser struct {
	CreatedAt     StubTime          `json:"created_at"`
	JoinedAt      StubTime          `json:"joined_at"`
	Name          string            `json:"name"`
	Username      string            `json:"username"`
	Discriminator string            `json:"discriminator"`
	GlobalName    string            `json:"global_name"`
	Mention       string            `json:"mention"`
	Avatar        string            `json:"avatar"`
	ID            discord.Snowflake `json:"id"`
	Bot           bool              `json:"bot"`
	Pending       bool              `json:"pending"`
}

StubUser represents a user on discord.

func (StubUser) String

func (s StubUser) String() string

type UserProvidedEmbed

type UserProvidedEmbed struct {
	Content string          `json:"content"`
	Embeds  []discord.Embed `json:"embeds"`
}

type WelcomerInteractionsContextKey

type WelcomerInteractionsContextKey int
const (
	PoolKey WelcomerInteractionsContextKey = iota
	QueriesKey
	ManagerNameKey
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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