cmd

package
v0.0.0-...-c0a088c Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Accept

func Accept(cmdInfo CommandInfo)

Accept will allow moderators (or bot controllers) to accept reputation application requests

The command usage should look like: ;accept 1234

func Close

func Close(cmdInfo CommandInfo)

Close will attempt to parse event or trade types and close the event by ID through host request

func Event

func Event(cmdInfo CommandInfo)

Event will parse through event commands and display embed with role ping

func Help

func Help(cmdInfo CommandInfo)

Help defines the bot's help command

It prints the help message of a specific bot command using Discord's message embedding

func List

func List(cmdInfo CommandInfo)

List will list all bot commands to the user

func Offer

func Offer(cmdInfo CommandInfo)

Offer handles the offer capabilities to trade options

func Queue

func Queue(cmdInfo CommandInfo)

Queue handles the queue-ing system; queue ids are retrieved from event ids defined in event.go

func Reject

func Reject(cmdInfo CommandInfo)

Reject allows admins to reject reputation requests

func Rep

func Rep(cmdInfo CommandInfo)

Rep will allow server members to update reputation points on another member

func Search(cmdInfo CommandInfo)

Search will look up a possible insect or fish in the database and display to the user

func Trade

func Trade(cmdInfo CommandInfo)

Trade will handle trade options within the server

Trade is meant to be paired along with offer.go in order for members to trade and offer items among each other

func Unregister

func Unregister(cmdInfo CommandInfo)

Unregister allows a queue user to remove themselves from the queue

Types

type CommandInfo

type CommandInfo struct {
	// AdminRole: ID of the role which can control bot
	AdminRole string

	// Ses: discord session (discord)
	Ses *discordgo.Session

	// Msg: discord message (discord)
	Msg *discordgo.MessageCreate

	// Service: contains all services needed by bot (bot)
	Service models.Services

	// Channel ID to post event notices
	ListingID string

	// Channel ID to post general bot commands
	BotChID string

	// Channel ID of rep applications
	AppID string

	// Prefix: the prefix the bot recognizes set in .config
	Prefix string

	// CmdName: contains the command name
	CmdName string

	// CmdOps: the full slice of commands (unparsed)
	CmdOps []string

	// CmdList: contains the names of all commands
	CmdList []string
}

CommandInfo represents all metadata discord and bot needs to execute certain API callbacks and commands

Jump to

Keyboard shortcuts

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