Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mattn committed Sep 21, 2024
1 parent f366ccc commit af7f637
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,19 @@ func server(from *time.Time) {
if ev.PubKey != pub {
for _, v := range ev.Tags {
if len(v) >= 2 && v[0] == "t" && v[1] == "俳句チェック" {
log.Println("test1")
s := normalize(ev.Content)
log.Println("test2", s)
var buf bytes.Buffer
haiku.MatchWithOpt(s, []int{5, 7, 5}, &haiku.Opt{Dict: kagomeDic, UserDict: userDic, Debug: true, DebugWriter: &buf})
log.Println("test3", buf.String())
err := replyEvent(postRelays, ev, buf.String())
if err != nil {
log.Println(err)
}
continue events_loop
}
if len(v) >= 2 && v[0] == "t" && v[1] == "短歌チェック" {
s := normalize(ev.Content)
var buf bytes.Buffer
haiku.MatchWithOpt(s, []int{5, 7, 5, 7, 7}, &haiku.Opt{Dict: kagomeDic, UserDict: userDic, Debug: true, DebugWriter: &buf})
err := replyEvent(postRelays, ev, buf.String())
if err != nil {
log.Println(err)
Expand Down

0 comments on commit af7f637

Please sign in to comment.