mirror of https://github.com/velour/catbase.git
commit
0956fd6044
|
@ -3,7 +3,9 @@
|
||||||
package picker
|
package picker
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
@ -28,6 +30,10 @@ func New(bot bot.Bot) *PickerPlugin {
|
||||||
// This function returns true if the plugin responds in a meaningful way to the users message.
|
// This function returns true if the plugin responds in a meaningful way to the users message.
|
||||||
// Otherwise, the function returns false and the bot continues execution of other plugins.
|
// Otherwise, the function returns false and the bot continues execution of other plugins.
|
||||||
func (p *PickerPlugin) Message(message msg.Message) bool {
|
func (p *PickerPlugin) Message(message msg.Message) bool {
|
||||||
|
if !strings.HasPrefix(body, "pick") {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
n, items, err := p.parse(message.Body)
|
n, items, err := p.parse(message.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
p.Bot.SendMessage(message.Channel, err.Error())
|
p.Bot.SendMessage(message.Channel, err.Error())
|
||||||
|
|
Loading…
Reference in New Issue