modelsx

package
v0.0.0-...-3f13264 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultEgoraptorTimeout = 60

DefaultEgoraptorTimeout is the default number of seconds to timeout users.

Variables

This section is empty.

Functions

func BumpMention

func BumpMention(ctx context.Context, exec boil.ContextExecutor, guildID discord.GuildID, userID discord.UserID) error

BumpMention bumps the count for an Egoraptor mention.

func FetchGuild

func FetchGuild(ctx context.Context, exec boil.ContextExecutor, id string) (*models.Guild, error)

FetchGuild fetches a guild from the database.

func FetchRoleUpdater

func FetchRoleUpdater(ctx context.Context, exec boil.ContextExecutor, id string) (*models.RoleUpdater, error)

FetchRoleUpdater fetches a role updater from the database.

func FetchSetting

FetchSetting fetches settings from the database, or returns a new one with defaults set.

func FetchTag

func FetchTag(ctx context.Context, exec boil.ContextExecutor, guild, name string) (*models.Tag, error)

FetchTag retrieves a tag from the database.

func FetchToken

func FetchToken(ctx context.Context, exec boil.ContextExecutor, id string) (*models.DiscordToken, error)

FetchToken fetches a Discord OAuth2 token by its associated user ID.

func FetchTopThreeMentions

func FetchTopThreeMentions(ctx context.Context, exec boil.ContextExecutor, id discord.GuildID) ([]*models.EgoraptorMention, error)

FetchTopThreeMentions fetches the top three Egoraptor mentions for a guild.

func FetchUserProfile

func FetchUserProfile(ctx context.Context, exec boil.ContextExecutor, id string) (*models.UserProfile, error)

FetchUserProfile fetches a user profile from the database.

func ModelToToken

func ModelToToken(dt *models.DiscordToken) *oauth2.Token

ModelToToken converts a stored Discord Token into an *oauth2.Token.

func RenameTag

func RenameTag(ctx context.Context, exec boil.ContextExecutor, tag *models.Tag, newName, editor string) error

RenameTag renames a tag in the database.

func ToggleGuildQuotes

func ToggleGuildQuotes(ctx context.Context, exec boil.ContextExecutor, guild *models.Guild, toggle bool) error

func TokenToModel

func TokenToModel(id string, tok *oauth2.Token) *models.DiscordToken

TokenToModel converts an OAuth2 token and user id to a Discord token.

func UpdateTagContent

func UpdateTagContent(ctx context.Context, exec boil.ContextExecutor, tag *models.Tag, content, editor string) error

UpdateTagContent updates a tag's content in the database.

func UpsertDiscordToken

func UpsertDiscordToken(ctx context.Context, exec boil.ContextExecutor, t *models.DiscordToken) error

UpsertDiscordToken inserts a Discord OAuth2 token, or upserts it on conflict.

func UpsertGuild

func UpsertGuild(ctx context.Context, exec boil.ContextExecutor, g *models.Guild) error

UpsertGuild inserts a guild, or updates it should it have changed.

func UpsertRoleUpdater

func UpsertRoleUpdater(ctx context.Context, exec boil.ContextExecutor, s *models.RoleUpdater) error

UpsertRoleUpdater inserts a role updater or updates it on conflict.

func UpsertSession

func UpsertSession(ctx context.Context, exec boil.ContextExecutor, s *models.Session) error

UpsertSession inserts a session, or upserts it on conflict.

func UpsertSetting

func UpsertSetting(ctx context.Context, exec boil.ContextExecutor, m *models.EgoraptorSetting) error

UpsertSetting inserts a setting, or updates it should it have changed.

func UpsertUserProfile

func UpsertUserProfile(ctx context.Context, exec boil.ContextExecutor, p *models.UserProfile) error

UpsertUserProfile inserts a user profile or updates it on conflict.

func UserProfileExists

func UserProfileExists(ctx context.Context, exec boil.ContextExecutor, id string) (bool, error)

UserProfileExists checks if a user profile exists within the database.

Types

This section is empty.

Jump to

Keyboard shortcuts

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