Documentation ¶
Overview ¶
General utility functions for moebot.
If there are any imports in this package that aren't part of the standard libary (or a /x/ or golang repoo) then that's a signal to move to a more specific package within util such as event or moeDiscord.
Index ¶
- Constants
- func ExtractChannelIdFromString(message string) (id string, valid bool)
- func ForceTitleCase(s string) string
- func GetInt64OrDefault(i sql.NullInt64) int64
- func GetStringOrDefault(s sql.NullString) string
- func IntContains(s []int, e int) bool
- func IntIndexOf(s []int, e int) int
- func IntRemove(s []int, e int) []int
- func MakeAlphaOnly(s string) string
- func MakeGif(text string) []byte
- func MakeStringBold(s string) string
- func MakeStringCode(s string) string
- func MakeStringItalic(s string) string
- func MakeStringStrikethrough(s string) string
- func NormalizeNewlines(s string) string
- func ParseIntervalToISO(interval string) (string, error)
- func StrContains(s []string, e string, caseInsensitive int) bool
- func StrContainsPrefix(s []string, e string, caseInsensitive int) bool
- func StringIndexOf(s []string, search string) int
- func Subtract(slice1 []int, slice2 []int) []int
- func UserIdToMention(userId string) string
- type SyncCooldownMap
- type SyncUIDByChannelMap
Constants ¶
View Source
const ( CaseInsensitive = iota CaseSensitive )
Variables ¶
This section is empty.
Functions ¶
func ForceTitleCase ¶
Forces title case for the given string. This is necessary when your string may contain upper case characters
func GetInt64OrDefault ¶
func GetStringOrDefault ¶
func GetStringOrDefault(s sql.NullString) string
func IntContains ¶
func IntIndexOf ¶
func MakeAlphaOnly ¶
func MakeStringBold ¶
func MakeStringCode ¶
func MakeStringItalic ¶
func MakeStringStrikethrough ¶
func NormalizeNewlines ¶
func ParseIntervalToISO ¶
func StringIndexOf ¶
func UserIdToMention ¶
Converts a user's ID into a mention. This is useful when you don't have a User object, but want to mention them
Types ¶
Directories ¶
Path | Synopsis |
---|---|
All database interactions and database tables within moebot's database
|
All database interactions and database tables within moebot's database |
Processing and type definitions for events within moebot.
|
Processing and type definitions for events within moebot. |
Extensions and additions to discordGo.
|
Extensions and additions to discordGo. |
Processing and retrieving information from reddit's API
|
Processing and retrieving information from reddit's API |
Click to show internal directories.
Click to hide internal directories.