https://github.com/ras0q/traq-chat
  
  
    Make creating traQ chat-bot easier. 
    https://github.com/ras0q/traq-chat
  
bot traq
        Last synced: 7 months ago 
        JSON representation
    
Make creating traQ chat-bot easier.
- Host: GitHub
- URL: https://github.com/ras0q/traq-chat
- Owner: ras0q
- License: mit
- Created: 2021-09-18T17:17:59.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-05-30T02:53:38.000Z (over 1 year ago)
- Last Synced: 2025-02-02T13:53:58.056Z (9 months ago)
- Topics: bot, traq
- Language: Go
- Homepage:
- Size: 36.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- 
            Metadata Files:
            - Readme: README.md
- License: LICENSE
 
Awesome Lists containing this project
README
          # traq-chat
Make creating traQBot easier.
## Example
```go
package main
import (
        "fmt"
        "os"
        "regexp"
        traqchat "github.com/ras0q/traq-chat"
)
func main() {
        q := traqchat.New(
                os.Getenv("BOT_ID"),
                os.Getenv("BOT_USER_ID"),
                os.Getenv("BOT_ACCESS_TOKEN"),
                os.Getenv("BOT_VERIFICATION_TOKEN"),
        )
        q.Hear(regexp.MustCompile(`ping`), func(res *traqchat.Response) error {
                res.Send("pong!")
                return nil
        })
        q.Respond(regexp.MustCompile(`Hello`), hello)
        q.Start(80)
}
func hello(res *traqchat.Response) error {
        res.Reply(fmt.Sprintf("Hello, %s\n", res.Message.User.DisplayName))
        return nil
}
```
## More Information for traQ Bot
- [traPtitech/traq-bot: traQ BOT用Goライブラリ](https://github.com/traPtitech/traq-bot)