Documentation ¶
Overview ¶
Provides a simple way to handle a potential command from a message sent by a user.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleCommand ¶
func HandleCommand(Command string)
Handles a command by passing it to a commandHandler with the arguments from Slice(..), a replytoken, and a client. The last two is given by the creator. The client will either be replying with a response message, or none (because of an error/nonexistent command).
Example ¶
//... switch message := event.Message.(type) { case *linebot.TextMessage: handler.HandleCommand(message.Text, replyToken, bot) }
Output: none (nothing)
func InsensitiveSlice ¶
Splits the message into a potential command arguments that is separated based on whitespace. This also makes the command case-insensitive.
func SensitiveSlice ¶
Splits the message into a potential command arguments that is separated based on whitespace. The case of the command remains unchanged.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.