Documentation ¶
Index ¶
- Variables
- func CalculateEmbedLength(embed *discordgo.MessageEmbed) int
- func CheckBlockDMChannel(redisClient *redis.Client, session *Session, userID string, err error) error
- func ColorCodeToHex(colour int) (hex string)
- func DMChannel(redisClient *redis.Client, session *Session, userID string) (string, error)
- func Delete(redis *redis.Client, session *Session, channelID string, messageID string, ...) error
- func DeleteBulk(redis *redis.Client, session *Session, channelID string, messageIDs []string, ...) error
- func DeleteSmart(redis *redis.Client, session *Session, channelID string, ...) error
- func EditComplexWithVars(redis *redis.Client, session *Session, localizations []interfaces.Localization, ...) (*discordgo.Message, error)
- func EscapeDiscordLax(text string) (output string)
- func EscapeDiscordStrict(text string) string
- func FindMessage(state *state.State, discord *Session, channelID string, messageID string) (*discordgo.Message, error)
- func HexToColorCode(hex string) int
- func Invite(redisClient *redis.Client, session *Session, inviteCode string) (*discordgo.Invite, error)
- func LookupMessageLink(state *state.State, discord *Session, link string) (*discordgo.Message, error)
- func MessageCodeFromMessage(message *discordgo.Message) string
- func MessageCodeToMessage(embedText string) *discordgo.MessageSend
- func Pagify(text string) []string
- func React(redis *redis.Client, session *Session, channelID string, messageID string, ...) error
- func RemoveReact(redis *redis.Client, session *Session, channelID string, messageID string, ...) error
- func SendComplexWithVars(session *Session, localizations []interfaces.Localization, channelID string, ...) ([]*discordgo.Message, error)
- func SetAPIBase(apiBase string)
- func TimeFromID(id string) (*time.Time, error)
- func Timestamp(when time.Time) string
- func TranslateEmbed(localizations []interfaces.Localization, embed *discordgo.MessageEmbed, ...) *discordgo.MessageEmbed
- func TranslateMessageEdit(localizations []interfaces.Localization, edit *discordgo.MessageEdit, ...) *discordgo.MessageEdit
- func TranslateMessageSend(localizations []interfaces.Localization, send *discordgo.MessageSend, ...) *discordgo.MessageSend
- func TrimEmbed(embed *discordgo.MessageEmbed) *discordgo.MessageEmbed
- func UserHasPermission(state interfaces.State, userID, channelID string, firstPermission int64, ...) bool
- func UserHasPermissionOr(state *state.State, userID, channelID string, firstPermission int64, ...) bool
- type Session
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidMessageLink = errors.New("invalid message link") ErrMessageOnWrongServer = errors.New("message on wrong server") )
var (
ErrNoDMChannel = errors.New("no DMs channel found, DMs might be disabled")
)
Functions ¶
func CalculateEmbedLength ¶
func CalculateEmbedLength(embed *discordgo.MessageEmbed) int
CalculateEmbedLength calculates the total length of embed
func CheckBlockDMChannel ¶
func ColorCodeToHex ¶
ColorCodeToHex converts a Discord Color Code into a hex string
func DeleteBulk ¶
func DeleteSmart ¶
func EditComplexWithVars ¶
func EditComplexWithVars( redis *redis.Client, session *Session, localizations []interfaces.Localization, edit *discordgo.MessageEdit, dm bool, values ...interface{}, ) (*discordgo.Message, error)
func EscapeDiscordLax ¶
EscapeDiscordLax escapes @ everyone, and @ here
func EscapeDiscordStrict ¶
EscapeDiscordStrict escapes all discord formatting options
func FindMessage ¶
func HexToColorCode ¶
ColorCodeToHex converts a hex string into a Discord Color Code
func LookupMessageLink ¶
func MessageCodeFromMessage ¶
func MessageCodeToMessage ¶
func MessageCodeToMessage(embedText string) *discordgo.MessageSend
func RemoveReact ¶
func SendComplexWithVars ¶
func SendComplexWithVars( session *Session, localizations []interfaces.Localization, channelID string, send *discordgo.MessageSend, values ...interface{}, ) ([]*discordgo.Message, error)
SendComplexWithVars sends a message to a given channelID using a given discord session it performs various on the actions: - pagifies the message content - trims the embed - escapes @ everyone, and @ here
func SetAPIBase ¶
func SetAPIBase(apiBase string)
func TimeFromID ¶
TimeFromID extracts a time from a Snowflake ID, used at the Discord API
func TranslateEmbed ¶
func TranslateEmbed( localizations []interfaces.Localization, embed *discordgo.MessageEmbed, values ...interface{}, ) *discordgo.MessageEmbed
TODO: replace emoji
func TranslateMessageEdit ¶
func TranslateMessageEdit( localizations []interfaces.Localization, edit *discordgo.MessageEdit, values ...interface{}, ) *discordgo.MessageEdit
func TranslateMessageSend ¶
func TranslateMessageSend( localizations []interfaces.Localization, send *discordgo.MessageSend, values ...interface{}, ) *discordgo.MessageSend
func TrimEmbed ¶
func TrimEmbed(embed *discordgo.MessageEmbed) *discordgo.MessageEmbed
TrimEmbed enforces Embed Limits to the given Embed Source: https://discordapp.com/developers/docs/resources/channel#embed-limits
func UserHasPermission ¶
func UserHasPermission( state interfaces.State, userID, channelID string, firstPermission int64, permissions ...int64, ) bool
UserHasPermission returns true if the User has all of th egiven permissions in the given channel