bot

package
v0.0.0-...-5619e0e Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const BotCommandPrefix string = "."

BotCommandPrefix is prefix for the bot's.

Variables

This section is empty.

Functions

func Echo

func Echo(session *discordgo.Session, channelID string, args string)

Echo command repeats what the user typed

func HandleCommands

func HandleCommands(session *discordgo.Session, message *discordgo.Message)

HandleCommands takes the message and calls proper function for the command

func HandleErrorDebug

func HandleErrorDebug(err error, errorMessage string)

HandleErrorDebug checks if there is an error and logs it

func HandleErrorFatal

func HandleErrorFatal(err error, errorMessage string)

HandleErrorFatal checks if there is an error and stops the program with an error

func HasPermission

func HasPermission(session *discordgo.Session, userID string, channelID string, perm int64) bool

HasPermission checks if the user given has the given permission

func Kick

func Kick(session *discordgo.Session, message *discordgo.Message)

Kick command kicks a user with a reason

func ParsePrefix

func ParsePrefix(message string) (string, string)

ParsePrefix returns the prefix + command and rest of the message split up

func Ping

func Ping(session *discordgo.Session, channelID string, timestamp discordgo.Timestamp)

Ping command sends the 2 way latency for the bot

func Purge

func Purge(session *discordgo.Session, message *discordgo.Message)

Purge command removes said number of messages from the channel its used in

func Run

func Run()

Run starts the bot

func TempBan

func TempBan(session *discordgo.Session, message *discordgo.Message)

TempBan temporarily bans a user with a reason

func Unban

func Unban(session *discordgo.Session, message *discordgo.Message)

Unban removes the ban on 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