Documentation ¶
Index ¶
- Constants
- type Bot
- func (bot *Bot) CheckCommandLimit(userID disgord.Snowflake, command string) *time.Time
- func (bot *Bot) HandleConnect(s disgord.Session, data *disgord.MessageCreate) error
- func (bot *Bot) HandleDocs(s disgord.Session, data *disgord.MessageCreate) error
- func (bot *Bot) HandleHelp(s disgord.Session, data *disgord.MessageCreate) error
- func (bot *Bot) HandleSendTokens(s disgord.Session, data *disgord.MessageCreate) error
- func (bot *Bot) HandleVerify(s disgord.Session, data *disgord.MessageCreate) error
- func (bot *Bot) NewCmdHandler(cmdName string, handler types.CmdHandler) disgord.HandlerMessageCreate
- func (bot *Bot) React(msg *disgord.Message, s disgord.Session, emoji interface{}, ...)
- func (bot *Bot) RefreshRoles()
- func (bot *Bot) Reply(msg *disgord.Message, s disgord.Session, message string)
- func (bot *Bot) SetCommandLimitation(userID disgord.Snowflake, cmd string)
- func (bot *Bot) Start()
- func (bot *Bot) Unreact(msg *disgord.Message, s disgord.Session, emoji interface{}, ...)
- type CallData
Constants ¶
const (
LogTxHash = "tx_hash"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bot ¶
type Bot struct {
// contains filtered or unexported fields
}
Bot represents the object that should be used to interact with Discord
func (*Bot) CheckCommandLimit ¶
CheckCommandLimit returns the date on which the given user will be able to run the command again
func (*Bot) HandleConnect ¶
HandleConnect handle a connection request. This request is done by the users when they want to connect their Desmos profile with their Discord account. The command expects one single argument which must be the JSON object returned from the "desmos sign" command.
The handling of the command will fail in the following occasions: 1. The signed value does not correspond to the username of the user sending the message 2. Any of the values are badly encoded
func (*Bot) HandleDocs ¶
HandleDocs handles the the request for docs by the user
func (*Bot) HandleHelp ¶
HandleHelp handles the the request for help by the user
func (*Bot) HandleSendTokens ¶
HandleSendTokens handles the sending of tokens to a user that asks them
func (*Bot) HandleVerify ¶
HandleVerify handles a verification request. This request is done by the user who already has a Desmos profile that is connected to their Discord profile. With this request they can verify everything has been completed successfully and get the role they deserve inside the Discord channel. This command has no arguments.
func (*Bot) NewCmdHandler ¶
func (bot *Bot) NewCmdHandler(cmdName string, handler types.CmdHandler) disgord.HandlerMessageCreate
NewCmdHandler returns a new command handler for the command that has the given name
func (*Bot) React ¶
func (bot *Bot) React(msg *disgord.Message, s disgord.Session, emoji interface{}, flags ...disgord.Flag)
React allows to react with the provided emoji to the given message
func (*Bot) RefreshRoles ¶ added in v0.3.0
func (bot *Bot) RefreshRoles()
RefreshRoles iterates over all the members and cleans their roles
func (*Bot) SetCommandLimitation ¶
SetCommandLimitation sets the limitation for the given user for the provided command