Documentation ¶
Index ¶
- Constants
- func BumpMention(ctx context.Context, exec boil.ContextExecutor, guildID discord.GuildID, ...) error
- func FetchGuild(ctx context.Context, exec boil.ContextExecutor, id string) (*models.Guild, error)
- func FetchLastSeen(ctx context.Context, exec boil.ContextExecutor, guildID discord.GuildID, ...) (*models.LastSeen, error)
- func FetchPing(ctx context.Context, exec boil.ContextExecutor, id int64) (*models.Ping, error)
- func FetchRoleUpdater(ctx context.Context, exec boil.ContextExecutor, id string) (*models.RoleUpdater, error)
- func FetchSetting(ctx context.Context, exec boil.ContextExecutor, id discord.GuildID) (*models.EgoraptorSetting, error)
- func FetchTag(ctx context.Context, exec boil.ContextExecutor, guild, name string) (*models.Tag, error)
- func FetchToken(ctx context.Context, exec boil.ContextExecutor, id string) (*models.DiscordToken, error)
- func FetchTopThreeMentions(ctx context.Context, exec boil.ContextExecutor, id discord.GuildID) ([]*models.EgoraptorMention, error)
- func FetchUserProfile(ctx context.Context, exec boil.ContextExecutor, id string) (*models.UserProfile, error)
- func ModelToToken(dt *models.DiscordToken) *oauth2.Token
- func RenameTag(ctx context.Context, exec boil.ContextExecutor, tag *models.Tag, ...) error
- func ToggleGuildQuotes(ctx context.Context, exec boil.ContextExecutor, guild *models.Guild, ...) error
- func TokenToModel(id string, tok *oauth2.Token) *models.DiscordToken
- func UpdatePing(ctx context.Context, exec boil.ContextExecutor, p *models.Ping, pattern string) error
- func UpdateTagContent(ctx context.Context, exec boil.ContextExecutor, tag *models.Tag, ...) error
- func UpsertDiscordToken(ctx context.Context, exec boil.ContextExecutor, t *models.DiscordToken) error
- func UpsertGuild(ctx context.Context, exec boil.ContextExecutor, g *models.Guild) error
- func UpsertLastSeen(ctx context.Context, exec boil.ContextExecutor, l *models.LastSeen) error
- func UpsertRoleUpdater(ctx context.Context, exec boil.ContextExecutor, s *models.RoleUpdater) error
- func UpsertSession(ctx context.Context, exec boil.ContextExecutor, s *models.Session) error
- func UpsertSetting(ctx context.Context, exec boil.ContextExecutor, m *models.EgoraptorSetting) error
- func UpsertUserProfile(ctx context.Context, exec boil.ContextExecutor, p *models.UserProfile) error
- func UserProfileExists(ctx context.Context, exec boil.ContextExecutor, id string) (bool, error)
Constants ¶
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 ¶
FetchGuild fetches a guild from the database.
func FetchLastSeen ¶
func FetchLastSeen(ctx context.Context, exec boil.ContextExecutor, guildID discord.GuildID, userID discord.UserID) (*models.LastSeen, error)
FetchLastSeen fetches the last time a user was seen in a guild.
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 ¶
func FetchSetting(ctx context.Context, exec boil.ContextExecutor, id discord.GuildID) (*models.EgoraptorSetting, error)
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
ToggleGuildQuotes toggles quotes for a guild.
func TokenToModel ¶
func TokenToModel(id string, tok *oauth2.Token) *models.DiscordToken
TokenToModel converts an OAuth2 token and user id to a Discord token.
func UpdatePing ¶
func UpdatePing(ctx context.Context, exec boil.ContextExecutor, p *models.Ping, pattern string) error
UpdatePing updates a ping's pattern.
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 ¶
UpsertGuild inserts a guild, or updates it should it have changed.
func UpsertLastSeen ¶
UpsertLastSeen inserts a last seen timestamp, 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 ¶
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 ¶
UserProfileExists checks if a user profile exists within the database.
Types ¶
This section is empty.