util

package
v0.0.0-...-c3d50c6 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrayContains

func ArrayContains(array []string, value string, ignoreCase bool) bool

ArrayContains checks a string array for a given string.

func ChannelSend

func ChannelSend(session *discordgo.Session, channelID, message string) (*discordgo.Message, error)

ChannelSend is a helper function for easily sending a message to the current channel.

func ChannelSendf

func ChannelSendf(
	session *discordgo.Session,
	channelID, format string,
	a ...interface{},
) (*discordgo.Message, error)

ChannelSendf is a helper function like ChannelSend for sending a formatted message to the current channel.

func GetID

func GetID(input string) string

GetID returns the ID (if there is one) from the supplied string

func GetMsgURL

func GetMsgURL(guildID, channelID, messageID string) string

func InitFile

func InitFile(path string) (*os.File, error)

InitFile opens a file at the specified path. If that file does not exist, it creates a new one.

func IsBot

func IsBot(test string) bool

IsBot checks if the supplied string is mentioning a bot

func IsChannel

func IsChannel(test string) bool

IsChannel checks if the supplied string is mentioning a channel

func IsID

func IsID(test string) bool

IsID checks if the supplied string is a Discord ID

func IsURL

func IsURL(test string) bool

IsURL checks the provided string to see if it's a valid URL.

func IsUser

func IsUser(test string) bool

IsUser checks if the supplied string is mentioning a user

Types

This section is empty.

Jump to

Keyboard shortcuts

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