Skip to content

Commit

Permalink
cleverbot & gemini: Fix regex to support line breaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Brawl345 committed Dec 19, 2023
1 parent 7fcdaa8 commit 01b94bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugin/cleverbot/cleverbot.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (p *Plugin) Commands() []telebot.Command {
func (p *Plugin) Handlers(botInfo *telebot.User) []plugin.Handler {
return []plugin.Handler{
&plugin.CommandHandler{
Trigger: regexp.MustCompile(fmt.Sprintf(`(?i)^/cbot(?:@%s)? (.+)$`, botInfo.Username)),
Trigger: regexp.MustCompile(fmt.Sprintf(`(?i)^/cbot(?:@%s)? ([\s\S]+)$`, botInfo.Username)),
HandlerFunc: p.onCleverbot,
GroupOnly: true,
},
Expand Down
4 changes: 2 additions & 2 deletions plugin/gemini/gemini.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (p *Plugin) Commands() []telebot.Command {
func (p *Plugin) Handlers(botInfo *telebot.User) []plugin.Handler {
return []plugin.Handler{
&plugin.CommandHandler{
Trigger: regexp.MustCompile(`(?i)^Bot, (.+)$`),
Trigger: regexp.MustCompile(`(?i)^Bot, ([\s\S]+)$`),
HandlerFunc: p.onGemini,
GroupOnly: true,
},
Expand All @@ -80,7 +80,7 @@ func (p *Plugin) Handlers(botInfo *telebot.User) []plugin.Handler {
GroupOnly: true,
},
&plugin.CommandHandler{
Trigger: regexp.MustCompile(fmt.Sprintf(`(?i)^/geminireset(?:@%s)? (.+)$`, botInfo.Username)),
Trigger: regexp.MustCompile(fmt.Sprintf(`(?i)^/geminireset(?:@%s)? ([\s\S]+)$`, botInfo.Username)),
HandlerFunc: p.onResetAndRun,
GroupOnly: true,
},
Expand Down

0 comments on commit 01b94bf

Please sign in to comment.