Documentation
¶
Index ¶
- Constants
- Variables
- func CategoryParser(s *discordgo.Session, category string, guildID string) (string, string)
- func ChMention(ch *discordgo.Channel) string
- func ChMentionID(channelID string) string
- func ChannelParser(s *discordgo.Session, channel string, guildID string) (string, string)
- func CommandErrorHandler(s *discordgo.Session, m *discordgo.Message, botLog entities.Cha, err error)
- func GetRedditRSSFeed(uri string, retryTimes int) (*gofeed.Feed, int, error)
- func GetUserID(m *discordgo.Message, messageSlice []string) (string, error)
- func LogError(s *discordgo.Session, botLog entities.Cha, err error)
- func ResolveTimeFromString(given string) (ret time.Time, perma bool, err error)
- func RoleParser(s *discordgo.Session, role string, guildID string) (string, string)
- func SplitLongMessage(message string) (split []string)
- func Uptime() time.Duration
- func WeekStart(year, week int) time.Time
- type SortChannelByAlphabet
- type SortRoleByAlphabet
- type UserAgentTransport
Constants ¶
const UserAgent = "script:github.com/apiks/zerotsu:v3.5 (by /u/thechosenapiks)"
Variables ¶
var StartTime time.Time
Functions ¶
func CategoryParser ¶
Parses a string for a category and returns its ID and name
func ChMentionID ¶
Mentions channel by channel ID. By Kagumi
func ChannelParser ¶
ChannelParser parses a string for a channel and returns its ID and name
func CommandErrorHandler ¶
func CommandErrorHandler(s *discordgo.Session, m *discordgo.Message, botLog entities.Cha, err error)
Sends error message to channel command is in. If that throws an error send error message to bot log channel
func GetRedditRSSFeed ¶
GetRedditRSSFeed parses a reddit uri for an RSS feed and returns it
func ResolveTimeFromString ¶
ResolveTimeFromString resolves a time (usually for unbanning) from a given string formatted #w#d#h#m. This returns current time + delay. If no time is added to the offset, then this returns true for permanent. By Kagumi. Modified by Apiks
func RoleParser ¶
RoleParser parses a string for a role and returns its ID and name
func SplitLongMessage ¶
SplitLongMessage takes a message and splits it if it's longer than 1900
Types ¶
type SortChannelByAlphabet ¶
Sorts channels alphabetically
func (SortChannelByAlphabet) Len ¶
func (r SortChannelByAlphabet) Len() int
func (SortChannelByAlphabet) Less ¶
func (r SortChannelByAlphabet) Less(i, j int) bool
func (SortChannelByAlphabet) Swap ¶
func (r SortChannelByAlphabet) Swap(i, j int)
type SortRoleByAlphabet ¶
SortRoleByAlphabet sorts roles alphabetically
func (SortRoleByAlphabet) Len ¶
func (r SortRoleByAlphabet) Len() int
func (SortRoleByAlphabet) Less ¶
func (r SortRoleByAlphabet) Less(i, j int) bool
func (SortRoleByAlphabet) Swap ¶
func (r SortRoleByAlphabet) Swap(i, j int)
type UserAgentTransport ¶
type UserAgentTransport struct { http.Transport http.RoundTripper }