acceptmsg

package
v0.0.0-...-99e36ab Latest Latest
Warning

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

Go to latest
Published: May 14, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package acceptmsg provides a message models for discordgo which can be either accepted or declined via reactions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcceptMessage

type AcceptMessage struct {
	*discordgo.Message
	Session        *discordgo.Session
	Embed          *discordgo.MessageEmbed
	UserID         string
	DeleteMsgAfter bool
	AcceptFunc     ActionHandler
	DeclineFunc    ActionHandler
	// contains filtered or unexported fields
}

AcceptMessage extends discordgo.Message to build and send an AcceptMessage.

func New

func New() *AcceptMessage

New creates an empty instance of AcceptMessage.

func (*AcceptMessage) AcceptOnlyUser

func (a *AcceptMessage) AcceptOnlyUser(userID string) *AcceptMessage

AcceptOnlyUser specifies only determined users can have inputs.

func (*AcceptMessage) DeleteAfterAnswer

func (a *AcceptMessage) DeleteAfterAnswer() *AcceptMessage

DeleteAfterAnswer enables embed message to be delete after users' answer.

func (*AcceptMessage) OnAccept

func (a *AcceptMessage) OnAccept(onAcc ActionHandler) *AcceptMessage

OnAccept specifies action handler to be executed if accept.

func (*AcceptMessage) OnDecline

func (a *AcceptMessage) OnDecline(onDec ActionHandler) *AcceptMessage

OnDecline specifies action handler to be executed if decline.

func (*AcceptMessage) Send

func (a *AcceptMessage) Send(channelID string) (*AcceptMessage, error)

Send pushes accept message into a channel and setup listener handler for reactions.

func (*AcceptMessage) WithContent

func (a *AcceptMessage) WithContent(content string) *AcceptMessage

WithContent creates an embed with default color and specified content as descriptions.

func (*AcceptMessage) WithEmbed

WithEmbed sets the embed instance.

func (*AcceptMessage) WithSession

func (a *AcceptMessage) WithSession(s *discordgo.Session) *AcceptMessage

WithSession set a discordgo.Session.

type ActionHandler

type ActionHandler func(*discordgo.Message)

Jump to

Keyboard shortcuts

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