Documentation ¶
Overview ¶
Package acceptmsg provides a message models for discordgo which can be either accepted or declined via reactions.
Index ¶
- type AcceptMessage
- func (a *AcceptMessage) AcceptOnlyUser(userID string) *AcceptMessage
- func (a *AcceptMessage) DeleteAfterAnswer() *AcceptMessage
- func (a *AcceptMessage) OnAccept(onAcc ActionHandler) *AcceptMessage
- func (a *AcceptMessage) OnDecline(onDec ActionHandler) *AcceptMessage
- func (a *AcceptMessage) Send(channelID string) (*AcceptMessage, error)
- func (a *AcceptMessage) WithContent(content string) *AcceptMessage
- func (a *AcceptMessage) WithEmbed(e *discordgo.MessageEmbed) *AcceptMessage
- func (a *AcceptMessage) WithSession(s *discordgo.Session) *AcceptMessage
- type ActionHandler
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 (*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 ¶
func (a *AcceptMessage) WithEmbed(e *discordgo.MessageEmbed) *AcceptMessage
WithEmbed sets the embed instance.
func (*AcceptMessage) WithSession ¶
func (a *AcceptMessage) WithSession(s *discordgo.Session) *AcceptMessage
WithSession set a discordgo.Session.