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
- Variables
- func AcquireSession(ctx context.Context, sub *subway.Subway, managerName string) (session *discord.Session, err error)
- func AddManagerNameToContext(ctx context.Context, v string) context.Context
- func AddPoolToContext(ctx context.Context, v *pgxpool.Pool) context.Context
- func AddQueriesToContext(ctx context.Context, v *database.Queries) context.Context
- func AssertLength(name string, expectedLength int, arguments ...interface{}) (err error)
- func Atoi(s string) (int64, error)
- func CheckGuildMemberships(memberships []*database.GetUserMembershipsByGuildIDRow) (hasWelcomerPro bool, hasCustomBackgrounds bool)
- func ConvertToRGBA(int32Color int64) color.RGBA
- func FilterAssignableRoles(ctx context.Context, sandwichClient protobuf.SandwichClient, ...) (out []discord.Snowflake, err error)
- func FormatString(funcs map[string]govaluate.ExpressionFunction, vars map[string]interface{}, ...) (string, error)
- func FormatTextStroke(v bool) int
- func GatherFunctions() (funcs map[string]govaluate.ExpressionFunction)
- func GatherVariables(eventCtx *sandwich.EventContext, member discord.GuildMember, ...) (vars map[string]interface{})
- func GetGuildMemberDisplayName(member discord.GuildMember) string
- func GetManagerNameFromContext(ctx context.Context) string
- func GetPoolFromContext(ctx context.Context) *pgxpool.Pool
- func GetQueriesFromContext(ctx context.Context) *database.Queries
- func GetUserAvatar(user *discord.User) string
- func GetUserDisplayName(user *discord.User) string
- func HumanizeDuration(seconds int) string
- func If[T any](condition bool, trueValue, falseValue T) T
- func IncludeBorderwallVerifyButton(messageParams *discord.MessageParams, borderwallLink string) *discord.MessageParams
- func IncludeScamsButton(messageParams *discord.MessageParams) *discord.MessageParams
- func IncludeSentByButton(messageParams *discord.MessageParams, guildName string) *discord.MessageParams
- func IsJSONBEmpty(b []byte) bool
- func IsMessageParamsEmpty(m discord.MessageParams) bool
- func IsValidBackground(s string) bool
- func IsValidColour(str string) bool
- func IsValidEmbed(s string) bool
- func IsValidHex(str string, allowAlpha bool) bool
- func IsValidImageAlignment(value string) bool
- func IsValidImageProfileBorderType(value string) bool
- func IsValidImageTheme(value string) bool
- func IsValidInteger(str string) bool
- func IsValidURL(url string) (*url.URL, bool)
- func IsValidUnsplashID(str string) bool
- func Itoa(v int64) string
- func MarshalTimeRolesJSON(roles []GuildSettingsTimeRolesRole) (rolesJSON []byte)
- func MemberHasElevation(discordGuild *discord.Guild, member discord.GuildMember) bool
- func NewEmbed(message string, color int32) []*discord.Embed
- func ParseColour(str string, defaultValue string) (*color.RGBA, error)
- func ParseUserAgent(userAgent string) (family, familyVersion, os, osVersion string)
- func RandStringBytesRmndr(n int) string
- func RequireGuild(interaction discord.Interaction, handler BasicInteractionHandler) (*discord.InteractionResponse, error)
- func RequireGuildElevation(sub *subway.Subway, interaction discord.Interaction, ...) (*discord.InteractionResponse, error)
- func SetupJSONB(jsonb pgtype.JSONB) pgtype.JSONB
- func SliceContains[T comparable](slice []T, value T) bool
- func StringToJsonLiteral(s string) jsoniter.RawMessage
- func ToPointer[K any](k K) *K
- func TryParseBool(str string) bool
- func TryParseFloat(str string) float64
- func TryParseInt(str string) int
- func ValidateRecaptcha(logger zerolog.Logger, response string, ipAddress string) (float64, error)
- type Background
- type BackgroundType
- type BasicIPChecker
- type BasicInteractionHandler
- type Currency
- type CustomEventInvokeBorderwallCompletionStructure
- type CustomEventInvokeBorderwallStructure
- type CustomEventInvokeLeaverStructure
- type CustomEventInvokeTempChannelsRemoveStructure
- type CustomEventInvokeTempChannelsStructure
- type CustomEventInvokeWelcomerStructure
- type GenerateImageOptionsRaw
- type GuildSettingsTimeRolesRole
- type IPChecker
- type IPIntelFlags
- type IPIntelOFlags
- type IPIntelResponse
- type ImageAlignment
- type ImageFileType
- type ImageProfileBorderType
- type ImageTheme
- type LRUIPChecker
- type OnInvokeBorderwallCompletionFuncType
- type OnInvokeBorderwallFuncType
- type OnInvokeLeaverFuncType
- type OnInvokeTempChannelsFuncType
- type OnInvokeTempChannelsRemoveFuncType
- type OnInvokeWelcomerFuncType
- type PricingSKU
- type RecaptchaRequest
- type RecaptchaResponse
- type SKUName
- type StubGuild
- type StubTime
- type StubUser
- type UserProvidedEmbed
- type WelcomerInteractionsContextKey
Constants ¶
const ( EmojiCheck = "<:check:1196902761627914402>" EmojiCross = "<:cross:1196902764048031744>" EmojiNeutral = "<:neutral:1196903241959620730>" EmojiRock = "<:rock:732274836038221855>" )
const ( EmbedColourInfo = 0x2F80ED EmbedColourSuccess = 0x4CD787 EmbedColourError = 0xFC6A70 EmbedColourWarn = 0xFBC01B )
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" )
const ( IPIntelFlagDefaultLookup IPIntelFlags = "" IPIntelFlagDynamicBanList IPIntelFlags = "m" IPIntelFlagDynamicBanListDynamicChecks IPIntelFlags = "b" IPIntelFlagForceFullLookup IPIntelFlags = "f" IPIntelOFlagOnlyBadIP IPIntelOFlags = "b" IPIntelOFlagShowCountry IPIntelOFlags = "c" IPIntelOFlagShowVPN IPIntelOFlags = "i" IPIntelOFlgagShowASN IPIntelOFlags = "a" )
const (
IPIntelEndpoint = "https://check.getipintel.net/check.php"
)
const (
RecaptchaEndpoint = "https://www.google.com/recaptcha/api/siteverify"
)
const (
UserAgent = "WelcomerService (https://github.com/WelcomerTeam/Welcomer)"
)
Variables ¶
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" )
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") )
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+)?\)$`) )
var ( True = true False = false )
var CountryMapping = map[string]Currency{ "IN": CurrencyINR, }
var GlobalCurrencies = []Currency{CurrencyEUR, CurrencyGBP, CurrencyUSD}
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 AddManagerNameToContext ¶
ManagerName context handler.
func AddPoolToContext ¶
Arguments context handler.
func AddQueriesToContext ¶
Queries context handler.
func AssertLength ¶
func CheckGuildMemberships ¶
func CheckGuildMemberships(memberships []*database.GetUserMembershipsByGuildIDRow) (hasWelcomerPro bool, hasCustomBackgrounds bool)
func ConvertToRGBA ¶
func FilterAssignableRoles ¶
func FormatString ¶
func FormatTextStroke ¶
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 GetUserAvatar ¶
func GetUserDisplayName ¶
func HumanizeDuration ¶
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 ¶
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 IsValidColour ¶
func IsValidEmbed ¶
func IsValidHex ¶
func IsValidImageAlignment ¶
func IsValidImageTheme ¶
func IsValidInteger ¶
func IsValidUnsplashID ¶
func MarshalTimeRolesJSON ¶
func MarshalTimeRolesJSON(roles []GuildSettingsTimeRolesRole) (rolesJSON []byte)
func MemberHasElevation ¶
func MemberHasElevation(discordGuild *discord.Guild, member discord.GuildMember) bool
func ParseColour ¶
ParseColour parses a colour and returns RGBA. Expected formats: #FFAAAA #FFAAAAFF RGBA(255, 255, 255, 0.1) RGB(255, 255, 255)
func ParseUserAgent ¶
func RandStringBytesRmndr ¶
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 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 TryParseBool ¶
func TryParseFloat ¶
func TryParseInt ¶
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 CustomEventInvokeBorderwallCompletionStructure ¶
type CustomEventInvokeBorderwallCompletionStructure struct {
Member discord.GuildMember
}
type CustomEventInvokeBorderwallStructure ¶
type CustomEventInvokeBorderwallStructure struct {
Member discord.GuildMember
}
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 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 RecaptchaResponse ¶
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.
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.
type UserProvidedEmbed ¶
type WelcomerInteractionsContextKey ¶
type WelcomerInteractionsContextKey int
const ( PoolKey WelcomerInteractionsContextKey = iota QueriesKey ManagerNameKey )